@valtimo/connector-management 4.21.0 → 5.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (107) hide show
  1. package/esm2020/lib/components/add-connector-configure/add-connector-configure.component.mjs +67 -0
  2. package/esm2020/lib/components/add-connector-select/add-connector-select.component.mjs +67 -0
  3. package/esm2020/lib/components/connector-link-extension/connector-link-extension.component.mjs +98 -0
  4. package/esm2020/lib/components/connector-link-extension-modal/connector-link-extension-modal.component.mjs +129 -0
  5. package/esm2020/lib/components/connector-management/connector-management.component.mjs +103 -0
  6. package/esm2020/lib/components/connector-modal/connector-modal.component.mjs +98 -0
  7. package/esm2020/lib/components/edit-connector-form/edit-connector-form.component.mjs +56 -0
  8. package/esm2020/lib/components/edit-connector-properties/edit-connector-properties.component.mjs +185 -0
  9. package/esm2020/lib/components/edit-product-aanvragen-connector/edit-product-aanvragen-connector.component.mjs +169 -0
  10. package/esm2020/lib/components/edit-product-aanvragen-connector/edit-product-aanvragen-connector.form.mjs +299 -0
  11. package/esm2020/lib/components/edit-taak-connector/edit-taak-connector.component.mjs +139 -0
  12. package/esm2020/lib/components/edit-taak-connector/edit-taak-connector.form.mjs +61 -0
  13. package/esm2020/lib/components/modify-connector/modify-connector.component.mjs +79 -0
  14. package/esm2020/lib/components/multi-value-connector-property/multi-value-connector-property.component.mjs +102 -0
  15. package/esm2020/lib/connector-management-routing.mjs +45 -0
  16. package/esm2020/lib/connector-management.module.mjs +153 -0
  17. package/esm2020/lib/extension/connector-management.extension.init.mjs +37 -0
  18. package/esm2020/lib/models/index.mjs +19 -0
  19. package/esm2020/lib/models/object-sync.mjs +2 -0
  20. package/esm2020/lib/services/connector-management/connector-management.service.mjs +56 -0
  21. package/esm2020/lib/services/connector-management-state/connector-management-state.service.mjs +152 -0
  22. package/esm2020/lib/services/object-api-sync/object-api-sync.service.mjs +47 -0
  23. package/esm2020/public-api.mjs +36 -0
  24. package/esm2020/valtimo-connector-management.mjs +5 -0
  25. package/fesm2015/valtimo-connector-management.mjs +2044 -0
  26. package/fesm2015/valtimo-connector-management.mjs.map +1 -0
  27. package/fesm2020/valtimo-connector-management.mjs +2041 -0
  28. package/fesm2020/valtimo-connector-management.mjs.map +1 -0
  29. package/lib/components/{add-connector/add-connector.component.d.ts → add-connector-configure/add-connector-configure.component.d.ts} +9 -9
  30. package/lib/components/add-connector-configure/add-connector-configure.component.d.ts.map +1 -0
  31. package/lib/components/add-connector-select/add-connector-select.component.d.ts +26 -0
  32. package/lib/components/add-connector-select/add-connector-select.component.d.ts.map +1 -0
  33. package/lib/components/connector-link-extension/connector-link-extension.component.d.ts +4 -0
  34. package/lib/components/connector-link-extension/connector-link-extension.component.d.ts.map +1 -0
  35. package/lib/components/connector-link-extension-modal/connector-link-extension-modal.component.d.ts +5 -2
  36. package/lib/components/connector-link-extension-modal/connector-link-extension-modal.component.d.ts.map +1 -0
  37. package/lib/components/connector-management/connector-management.component.d.ts +7 -2
  38. package/lib/components/connector-management/connector-management.component.d.ts.map +1 -0
  39. package/lib/components/connector-modal/connector-modal.component.d.ts +23 -7
  40. package/lib/components/connector-modal/connector-modal.component.d.ts.map +1 -0
  41. package/lib/components/edit-connector-form/edit-connector-form.component.d.ts +5 -0
  42. package/lib/components/edit-connector-form/edit-connector-form.component.d.ts.map +1 -0
  43. package/lib/components/edit-connector-properties/edit-connector-properties.component.d.ts +14 -2
  44. package/lib/components/edit-connector-properties/edit-connector-properties.component.d.ts.map +1 -0
  45. package/lib/components/edit-product-aanvragen-connector/edit-product-aanvragen-connector.component.d.ts +9 -1
  46. package/lib/components/edit-product-aanvragen-connector/edit-product-aanvragen-connector.component.d.ts.map +1 -0
  47. package/lib/components/edit-product-aanvragen-connector/edit-product-aanvragen-connector.form.d.ts +1 -0
  48. package/lib/components/edit-product-aanvragen-connector/edit-product-aanvragen-connector.form.d.ts.map +1 -0
  49. package/lib/components/edit-taak-connector/edit-taak-connector.component.d.ts +9 -1
  50. package/lib/components/edit-taak-connector/edit-taak-connector.component.d.ts.map +1 -0
  51. package/lib/components/edit-taak-connector/edit-taak-connector.form.d.ts +1 -0
  52. package/lib/components/edit-taak-connector/edit-taak-connector.form.d.ts.map +1 -0
  53. package/lib/components/modify-connector/modify-connector.component.d.ts +6 -0
  54. package/lib/components/modify-connector/modify-connector.component.d.ts.map +1 -0
  55. package/lib/components/multi-value-connector-property/multi-value-connector-property.component.d.ts +4 -0
  56. package/lib/components/multi-value-connector-property/multi-value-connector-property.component.d.ts.map +1 -0
  57. package/lib/connector-management-routing.d.ts +7 -0
  58. package/lib/connector-management-routing.d.ts.map +1 -0
  59. package/lib/connector-management.module.d.ts +23 -0
  60. package/lib/connector-management.module.d.ts.map +1 -0
  61. package/lib/extension/connector-management.extension.init.d.ts +1 -0
  62. package/lib/extension/connector-management.extension.init.d.ts.map +1 -0
  63. package/lib/models/index.d.ts +1 -0
  64. package/lib/models/index.d.ts.map +1 -0
  65. package/lib/models/object-sync.d.ts +1 -0
  66. package/lib/models/object-sync.d.ts.map +1 -0
  67. package/lib/services/connector-management/connector-management.service.d.ts +4 -0
  68. package/lib/services/connector-management/connector-management.service.d.ts.map +1 -0
  69. package/lib/services/connector-management-state/connector-management-state.service.d.ts +32 -2
  70. package/lib/services/connector-management-state/connector-management-state.service.d.ts.map +1 -0
  71. package/lib/services/object-api-sync/object-api-sync.service.d.ts +4 -0
  72. package/lib/services/object-api-sync/object-api-sync.service.d.ts.map +1 -0
  73. package/package.json +23 -10
  74. package/public-api.d.ts +5 -1
  75. package/public-api.d.ts.map +1 -0
  76. package/valtimo-connector-management.d.ts +2 -4
  77. package/valtimo-connector-management.d.ts.map +1 -0
  78. package/bundles/valtimo-connector-management.umd.js +0 -2118
  79. package/bundles/valtimo-connector-management.umd.js.map +0 -1
  80. package/bundles/valtimo-connector-management.umd.min.js +0 -16
  81. package/bundles/valtimo-connector-management.umd.min.js.map +0 -1
  82. package/esm2015/lib/components/add-connector/add-connector.component.js +0 -83
  83. package/esm2015/lib/components/connector-link-extension/connector-link-extension.component.js +0 -104
  84. package/esm2015/lib/components/connector-link-extension-modal/connector-link-extension-modal.component.js +0 -138
  85. package/esm2015/lib/components/connector-management/connector-management.component.js +0 -103
  86. package/esm2015/lib/components/connector-modal/connector-modal.component.js +0 -58
  87. package/esm2015/lib/components/edit-connector-form/edit-connector-form.component.js +0 -44
  88. package/esm2015/lib/components/edit-connector-properties/edit-connector-properties.component.js +0 -144
  89. package/esm2015/lib/components/edit-product-aanvragen-connector/edit-product-aanvragen-connector.component.js +0 -160
  90. package/esm2015/lib/components/edit-product-aanvragen-connector/edit-product-aanvragen-connector.form.js +0 -301
  91. package/esm2015/lib/components/edit-taak-connector/edit-taak-connector.component.js +0 -129
  92. package/esm2015/lib/components/edit-taak-connector/edit-taak-connector.form.js +0 -63
  93. package/esm2015/lib/components/modify-connector/modify-connector.component.js +0 -75
  94. package/esm2015/lib/components/multi-value-connector-property/multi-value-connector-property.component.js +0 -96
  95. package/esm2015/lib/connector-management-routing.js +0 -41
  96. package/esm2015/lib/connector-management.module.js +0 -77
  97. package/esm2015/lib/extension/connector-management.extension.init.js +0 -39
  98. package/esm2015/lib/models/index.js +0 -19
  99. package/esm2015/lib/models/object-sync.js +0 -1
  100. package/esm2015/lib/services/connector-management/connector-management.service.js +0 -60
  101. package/esm2015/lib/services/connector-management-state/connector-management-state.service.js +0 -83
  102. package/esm2015/lib/services/object-api-sync/object-api-sync.service.js +0 -51
  103. package/esm2015/public-api.js +0 -33
  104. package/esm2015/valtimo-connector-management.js +0 -9
  105. package/fesm2015/valtimo-connector-management.js +0 -1791
  106. package/fesm2015/valtimo-connector-management.js.map +0 -1
  107. package/valtimo-connector-management.metadata.json +0 -1
@@ -0,0 +1,2041 @@
1
+ import * as i0 from '@angular/core';
2
+ import { Injectable, EventEmitter, Component, Input, Output, ViewChild, NgModule } from '@angular/core';
3
+ import * as i5 from '@angular/router';
4
+ import { RouterModule } from '@angular/router';
5
+ import * as i6 from '@angular/common';
6
+ import { CommonModule } from '@angular/common';
7
+ import { AuthGuardService } from '@valtimo/security';
8
+ import * as i2 from '@valtimo/config';
9
+ import { ROLE_ADMIN, ConfigService, Extension, BasicExtensionPoint } from '@valtimo/config';
10
+ import { Subject, BehaviorSubject, combineLatest, timer, of } from 'rxjs';
11
+ import { take, map, tap, switchMap, catchError } from 'rxjs/operators';
12
+ import * as i1 from '@angular/common/http';
13
+ import * as i2$1 from '@ngx-translate/core';
14
+ import { TranslateModule } from '@ngx-translate/core';
15
+ import * as i2$2 from '@valtimo/user-interface';
16
+ import { ButtonModule, TableModule, ModalModule as ModalModule$1, StepperModule, CardModule, TitleModule, InputModule, PageModule, ParagraphModule } from '@valtimo/user-interface';
17
+ import * as i6$1 from '@valtimo/components';
18
+ import { WidgetModule, ListModule, SpinnerModule, ModalModule, FormIoModule } from '@valtimo/components';
19
+ import { set, cloneDeep, get } from 'lodash';
20
+ import * as i1$1 from '@valtimo/form';
21
+ import * as i2$3 from '@valtimo/document';
22
+ import * as i8 from '@angular/flex-layout/extended';
23
+ import * as i6$2 from '@angular/flex-layout/flex';
24
+ import { FlexLayoutModule } from '@angular/flex-layout';
25
+ import { NGXLogger } from 'ngx-logger';
26
+
27
+ /*
28
+ *
29
+ * * Copyright 2015-2020 Ritense BV, the Netherlands.
30
+ * *
31
+ * * Licensed under EUPL, Version 1.2 (the "License");
32
+ * * you may not use this file except in compliance with the License.
33
+ * * You may obtain a copy of the License at
34
+ * *
35
+ * * https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12
36
+ * *
37
+ * * Unless required by applicable law or agreed to in writing, software
38
+ * * distributed under the License is distributed on an "AS IS" basis,
39
+ * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
40
+ * * See the License for the specific language governing permissions and
41
+ * * limitations under the License.
42
+ *
43
+ */
44
+
45
+ /*
46
+ * Copyright 2020 Dimpact.
47
+ *
48
+ * Licensed under EUPL, Version 1.2 (the "License");
49
+ * you may not use this file except in compliance with the License.
50
+ * You may obtain a copy of the License at
51
+ *
52
+ * https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12
53
+ *
54
+ * Unless required by applicable law or agreed to in writing, software
55
+ * distributed under the License is distributed on an "AS IS" basis,
56
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
57
+ * See the License for the specific language governing permissions and
58
+ * limitations under the License.
59
+ */
60
+ class ConnectorManagementService {
61
+ constructor(http, configService) {
62
+ this.http = http;
63
+ this.configService = configService;
64
+ this.valtimoApiConfig = configService.config.valtimoApi;
65
+ }
66
+ getConnectorInstances(params) {
67
+ return this.http.get(`${this.valtimoApiConfig.endpointUri}connector/instance`, { params });
68
+ }
69
+ getConnectorInstancesByType(typeId, params) {
70
+ return this.http.get(`${this.valtimoApiConfig.endpointUri}connector/instance/${typeId}`, { params });
71
+ }
72
+ getConnectorInstanceById(instanceId) {
73
+ return this.http.get(`${this.valtimoApiConfig.endpointUri}connector/instance?instanceId=${instanceId}`);
74
+ }
75
+ getConnectorTypes() {
76
+ return this.http.get(`${this.valtimoApiConfig.endpointUri}connector/type`);
77
+ }
78
+ createConnectorInstance(request) {
79
+ return this.http.post(`${this.valtimoApiConfig.endpointUri}connector/instance`, request);
80
+ }
81
+ updateConnectorInstance(request) {
82
+ return this.http.put(`${this.valtimoApiConfig.endpointUri}connector/instance`, request);
83
+ }
84
+ deleteConnectorInstance(connectorInstanceId) {
85
+ return this.http.delete(`${this.valtimoApiConfig.endpointUri}connector/instance/${connectorInstanceId}`);
86
+ }
87
+ }
88
+ ConnectorManagementService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.9", ngImport: i0, type: ConnectorManagementService, deps: [{ token: i1.HttpClient }, { token: i2.ConfigService }], target: i0.ɵɵFactoryTarget.Injectable });
89
+ ConnectorManagementService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "13.3.9", ngImport: i0, type: ConnectorManagementService, providedIn: 'root' });
90
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.9", ngImport: i0, type: ConnectorManagementService, decorators: [{
91
+ type: Injectable,
92
+ args: [{
93
+ providedIn: 'root',
94
+ }]
95
+ }], ctorParameters: function () { return [{ type: i1.HttpClient }, { type: i2.ConfigService }]; } });
96
+
97
+ /*
98
+ * Copyright 2020 Dimpact.
99
+ *
100
+ * Licensed under EUPL, Version 1.2 (the "License");
101
+ * you may not use this file except in compliance with the License.
102
+ * You may obtain a copy of the License at
103
+ *
104
+ * https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12
105
+ *
106
+ * Unless required by applicable law or agreed to in writing, software
107
+ * distributed under the License is distributed on an "AS IS" basis,
108
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
109
+ * See the License for the specific language governing permissions and
110
+ * limitations under the License.
111
+ */
112
+ class ConnectorManagementStateService {
113
+ constructor() {
114
+ this._showModal$ = new Subject();
115
+ this._hideModal$ = new Subject();
116
+ this._showExtensionModal$ = new BehaviorSubject(false);
117
+ this._inputDisabled$ = new BehaviorSubject(false);
118
+ this._saveButtonDisabled$ = new BehaviorSubject(true);
119
+ this._refresh$ = new BehaviorSubject(null);
120
+ this._save$ = new Subject();
121
+ this._selectedInstance$ = new BehaviorSubject(undefined);
122
+ this._lastConfigIdAdded$ = new BehaviorSubject('');
123
+ this._selectedConnector$ = new BehaviorSubject(undefined);
124
+ this._connectorTypes$ = new BehaviorSubject(undefined);
125
+ this._modalType$ = new BehaviorSubject('add');
126
+ this._delete$ = new Subject();
127
+ this._hideModalSaveButton$ = new BehaviorSubject(false);
128
+ }
129
+ get showModal$() {
130
+ return this._showModal$.asObservable();
131
+ }
132
+ get hideModal$() {
133
+ return this._hideModal$.asObservable();
134
+ }
135
+ get showExtensionModal$() {
136
+ return this._showExtensionModal$.asObservable();
137
+ }
138
+ get inputDisabled$() {
139
+ return this._inputDisabled$.asObservable();
140
+ }
141
+ get refresh$() {
142
+ return this._refresh$.asObservable();
143
+ }
144
+ get selectedInstance$() {
145
+ return this._selectedInstance$.asObservable();
146
+ }
147
+ get lastConfigIdAdded$() {
148
+ return this._lastConfigIdAdded$.asObservable();
149
+ }
150
+ get selectedConnector$() {
151
+ return this._selectedConnector$.asObservable();
152
+ }
153
+ get connectorTypes$() {
154
+ return this._connectorTypes$.asObservable();
155
+ }
156
+ get saveButtonDisabled$() {
157
+ return this._saveButtonDisabled$.asObservable();
158
+ }
159
+ get save$() {
160
+ return this._save$.asObservable();
161
+ }
162
+ get modalType$() {
163
+ return this._modalType$.asObservable();
164
+ }
165
+ get delete$() {
166
+ return this._delete$.asObservable();
167
+ }
168
+ get hideModalSaveButton$() {
169
+ return this._hideModalSaveButton$.asObservable();
170
+ }
171
+ showModal() {
172
+ this._showModal$.next();
173
+ }
174
+ hideModal() {
175
+ this._hideModal$.next();
176
+ }
177
+ showExtensionModal() {
178
+ this._showExtensionModal$.next(true);
179
+ }
180
+ hideExtensionModal() {
181
+ this._showExtensionModal$.next(false);
182
+ }
183
+ disableInput() {
184
+ this._inputDisabled$.next(true);
185
+ }
186
+ enableInput() {
187
+ this._inputDisabled$.next(false);
188
+ }
189
+ refresh() {
190
+ this._refresh$.next(null);
191
+ }
192
+ setConnectorInstance(instance) {
193
+ this._selectedInstance$.next(instance);
194
+ }
195
+ setLastConfigIdAdded(id) {
196
+ this._lastConfigIdAdded$.next(id);
197
+ }
198
+ clearLastConfigIdAdded() {
199
+ this._lastConfigIdAdded$.next('');
200
+ }
201
+ setSelectedConnectorType(connectorType) {
202
+ this._selectedConnector$.next(connectorType);
203
+ }
204
+ clearSelectedConnector() {
205
+ this._selectedConnector$.next(undefined);
206
+ }
207
+ setConnectorTypes(connectorTypes) {
208
+ this._connectorTypes$.next(connectorTypes);
209
+ }
210
+ enableSaveButton() {
211
+ this._saveButtonDisabled$.next(false);
212
+ }
213
+ disableSaveButton() {
214
+ this._saveButtonDisabled$.next(true);
215
+ }
216
+ save() {
217
+ this._saveButtonDisabled$.pipe(take(1)).subscribe(saveButtonDisabled => {
218
+ if (!saveButtonDisabled) {
219
+ this._save$.next();
220
+ }
221
+ });
222
+ }
223
+ setModalType(type) {
224
+ this._modalType$.next(type);
225
+ }
226
+ delete() {
227
+ this._delete$.next();
228
+ }
229
+ hideModalSaveButton() {
230
+ this._hideModalSaveButton$.next(true);
231
+ }
232
+ showModalSaveButton() {
233
+ this._hideModalSaveButton$.next(false);
234
+ }
235
+ }
236
+ ConnectorManagementStateService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.9", ngImport: i0, type: ConnectorManagementStateService, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
237
+ ConnectorManagementStateService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "13.3.9", ngImport: i0, type: ConnectorManagementStateService, providedIn: 'root' });
238
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.9", ngImport: i0, type: ConnectorManagementStateService, decorators: [{
239
+ type: Injectable,
240
+ args: [{
241
+ providedIn: 'root',
242
+ }]
243
+ }] });
244
+
245
+ /*
246
+ * Copyright 2015-2020 Ritense BV, the Netherlands.
247
+ *
248
+ * Licensed under EUPL, Version 1.2 (the "License");
249
+ * you may not use this file except in compliance with the License.
250
+ * You may obtain a copy of the License at
251
+ *
252
+ * https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12
253
+ *
254
+ * Unless required by applicable law or agreed to in writing, software
255
+ * distributed under the License is distributed on an "AS IS" basis,
256
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
257
+ * See the License for the specific language governing permissions and
258
+ * limitations under the License.
259
+ */
260
+ class MultiValueConnectorPropertyComponent {
261
+ constructor() {
262
+ this.valuesSet = new EventEmitter();
263
+ this.amountOfValues$ = new BehaviorSubject([null]);
264
+ this.removeButtonDisabled$ = this.amountOfValues$.pipe(map(amountOfValues => amountOfValues.length === 1));
265
+ this.values$ = new BehaviorSubject({});
266
+ this.addButtonDisabled$ = combineLatest([this.values$, this.amountOfValues$]).pipe(map(([values, amountOfValues]) => {
267
+ const objectValues = Object.values(values);
268
+ const validObjectValues = objectValues.filter(value => value === 0 || value);
269
+ return amountOfValues.length !== validObjectValues.length;
270
+ }));
271
+ }
272
+ ngOnInit() {
273
+ this.openValuesSubscription();
274
+ this.setDefaults();
275
+ }
276
+ ngOnDestroy() {
277
+ this.valuesSubscription?.unsubscribe();
278
+ }
279
+ onValueChange(value, editField, index) {
280
+ this.values$.pipe(take(1)).subscribe(values => {
281
+ this.values$.next({
282
+ ...values,
283
+ [index]: editField.editType === 'string[]'
284
+ ? value.trim()
285
+ : parseInt(value, 10),
286
+ });
287
+ });
288
+ }
289
+ addRow() {
290
+ this.amountOfValues$.pipe(take(1)).subscribe(amountOfValues => {
291
+ this.amountOfValues$.next([...amountOfValues, null]);
292
+ });
293
+ }
294
+ removeRow() {
295
+ combineLatest([this.values$, this.amountOfValues$])
296
+ .pipe(take(1))
297
+ .subscribe(([values, amountOfValues]) => {
298
+ const lastValueIndex = amountOfValues.length - 1;
299
+ const valuesCopy = { ...values };
300
+ delete valuesCopy[lastValueIndex];
301
+ this.values$.next(valuesCopy);
302
+ this.amountOfValues$.next(amountOfValues.filter((curr, index) => index !== lastValueIndex));
303
+ });
304
+ }
305
+ openValuesSubscription() {
306
+ this.valuesSubscription = this.values$.subscribe(values => {
307
+ this.valuesSet.emit({
308
+ editFieldKey: this.editField.key,
309
+ values: Object.values(values).filter(value => value === 0 || value),
310
+ });
311
+ });
312
+ }
313
+ setDefaults() {
314
+ const defaultValue = this.defaultValue;
315
+ const validValues = Array.isArray(defaultValue) && defaultValue.filter(value => value === 0 || value);
316
+ if (validValues && validValues.length > 0) {
317
+ const valuesObject = {};
318
+ validValues.forEach((value, index) => {
319
+ valuesObject[index] = value;
320
+ });
321
+ this.values$.next(valuesObject);
322
+ this.amountOfValues$.next(validValues.map(() => null));
323
+ }
324
+ }
325
+ }
326
+ MultiValueConnectorPropertyComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.9", ngImport: i0, type: MultiValueConnectorPropertyComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
327
+ MultiValueConnectorPropertyComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.3.9", type: MultiValueConnectorPropertyComponent, selector: "valtimo-multi-value-connector-property", inputs: { editField: "editField", disabled: "disabled", defaultValue: "defaultValue" }, outputs: { valuesSet: "valuesSet" }, ngImport: i0, 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\n *ngTemplateOutlet=\"input; context: {index: index, disabled: disabled, values: obs.values}\"\n >\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\n class=\"btn btn-danger btn-space btn-sm\"\n (click)=\"removeRow()\"\n [disabled]=\"disabled || (removeButtonDisabled$ | async)\"\n >\n <i class=\"icon mdi mdi-delete mr-1\"></i>\n {{ 'connectorManagement.removeValue' | translate }}\n </button>\n <button\n class=\"btn btn-secondary btn-space mr-0 btn-sm\"\n (click)=\"addRow()\"\n [disabled]=\"disabled || (addButtonDisabled$ | async)\"\n >\n <i class=\"icon mdi mdi-plus mr-1\"></i>\n {{ 'connectorManagement.addValue' | translate }}\n </button>\n </div>\n</ng-template>\n", 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;width:100%;justify-content:flex-end}\n"], directives: [{ type: i6.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { type: i6.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { type: i6.NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet"] }], pipes: { "async": i6.AsyncPipe, "translate": i2$1.TranslatePipe } });
328
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.9", ngImport: i0, type: MultiValueConnectorPropertyComponent, decorators: [{
329
+ type: Component,
330
+ args: [{ selector: 'valtimo-multi-value-connector-property', 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\n *ngTemplateOutlet=\"input; context: {index: index, disabled: disabled, values: obs.values}\"\n >\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\n class=\"btn btn-danger btn-space btn-sm\"\n (click)=\"removeRow()\"\n [disabled]=\"disabled || (removeButtonDisabled$ | async)\"\n >\n <i class=\"icon mdi mdi-delete mr-1\"></i>\n {{ 'connectorManagement.removeValue' | translate }}\n </button>\n <button\n class=\"btn btn-secondary btn-space mr-0 btn-sm\"\n (click)=\"addRow()\"\n [disabled]=\"disabled || (addButtonDisabled$ | async)\"\n >\n <i class=\"icon mdi mdi-plus mr-1\"></i>\n {{ 'connectorManagement.addValue' | translate }}\n </button>\n </div>\n</ng-template>\n", 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;width:100%;justify-content:flex-end}\n"] }]
331
+ }], propDecorators: { editField: [{
332
+ type: Input
333
+ }], disabled: [{
334
+ type: Input
335
+ }], defaultValue: [{
336
+ type: Input
337
+ }], valuesSet: [{
338
+ type: Output
339
+ }] } });
340
+
341
+ /*
342
+ * Copyright 2015-2020 Ritense BV, the Netherlands.
343
+ *
344
+ * Licensed under EUPL, Version 1.2 (the "License");
345
+ * you may not use this file except in compliance with the License.
346
+ * You may obtain a copy of the License at
347
+ *
348
+ * https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12
349
+ *
350
+ * Unless required by applicable law or agreed to in writing, software
351
+ * distributed under the License is distributed on an "AS IS" basis,
352
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
353
+ * See the License for the specific language governing permissions and
354
+ * limitations under the License.
355
+ */
356
+ class EditConnectorPropertiesComponent {
357
+ constructor(stateService) {
358
+ this.stateService = stateService;
359
+ this.withDefaults = false;
360
+ this.showDeleteButton = false;
361
+ this.showSaveButton = true;
362
+ this.propertiesSave = new EventEmitter();
363
+ this.connectorDelete = new EventEmitter();
364
+ this.modifiedProperties$ = new BehaviorSubject(undefined);
365
+ this.editFields$ = new BehaviorSubject([]);
366
+ this.connectorName$ = new BehaviorSubject('');
367
+ this.saveButtonDisabled$ = this.stateService.saveButtonDisabled$;
368
+ this.disabled$ = this.stateService.inputDisabled$;
369
+ }
370
+ ngOnInit() {
371
+ this.setEditFields();
372
+ this.setName();
373
+ this.openSaveButtonDisabledSubscription();
374
+ this.openSaveSubscription();
375
+ this.openDeleteSubscription();
376
+ this.stateService.showModalSaveButton();
377
+ }
378
+ ngOnChanges() {
379
+ this.setEditFields();
380
+ this.setName();
381
+ }
382
+ ngOnDestroy() {
383
+ this.saveButtonDisabledSubscription?.unsubscribe();
384
+ this.saveSubscription?.unsubscribe();
385
+ this.deleteSubscription?.unsubscribe();
386
+ }
387
+ multiFieldValuesSet(event) {
388
+ this.modifiedProperties$.pipe(take(1)).subscribe(properties => {
389
+ set(properties, event.editFieldKey, event.values);
390
+ this.modifiedProperties$.next(properties);
391
+ });
392
+ }
393
+ onSingleValueChange(value, editField) {
394
+ this.modifiedProperties$.pipe(take(1)).subscribe(properties => {
395
+ set(properties, editField.key, editField.editType === 'string' ? value.trim() : parseInt(value, 10));
396
+ this.modifiedProperties$.next(properties);
397
+ });
398
+ }
399
+ onNameValueChange(value) {
400
+ this.connectorName$.next(value.trim());
401
+ }
402
+ onSave() {
403
+ this.stateService.disableInput();
404
+ combineLatest([this.modifiedProperties$, this.connectorName$])
405
+ .pipe(take(1))
406
+ .subscribe(([properties, name]) => {
407
+ this.propertiesSave.emit({ properties, name });
408
+ });
409
+ }
410
+ onDelete() {
411
+ this.stateService.disableInput();
412
+ this.connectorDelete.emit();
413
+ }
414
+ setName() {
415
+ if (this.withDefaults && this.defaultName) {
416
+ this.connectorName$.next(this.defaultName);
417
+ }
418
+ else {
419
+ this.connectorName$.next('');
420
+ }
421
+ }
422
+ setModifiedProperties(editFields) {
423
+ const propertiesCopy = cloneDeep(this.properties);
424
+ if (!this.withDefaults) {
425
+ editFields.forEach(editField => {
426
+ set(propertiesCopy, editField.key, undefined);
427
+ });
428
+ }
429
+ this.modifiedProperties$.next(propertiesCopy);
430
+ }
431
+ setEditFields() {
432
+ const editFields = [];
433
+ const keysToFilter = ['className'];
434
+ const handlePropertyLevel = (propertyLevel, previousKeys) => {
435
+ const propertyLevelKeys = Object.keys(propertyLevel).filter(key => !keysToFilter.includes(key));
436
+ propertyLevelKeys.forEach(key => {
437
+ const propertyValue = propertyLevel[key];
438
+ const baseEditField = {
439
+ key: previousKeys + key,
440
+ ...(this.withDefaults && { defaultValue: propertyValue }),
441
+ };
442
+ if (typeof propertyValue === 'number') {
443
+ editFields.push({ ...baseEditField, editType: 'number' });
444
+ }
445
+ else if (Array.isArray(propertyValue)) {
446
+ if (propertyValue[0] && typeof propertyValue[0] === 'number') {
447
+ editFields.push({ ...baseEditField, editType: 'number[]' });
448
+ }
449
+ else {
450
+ editFields.push({ ...baseEditField, editType: 'string[]' });
451
+ }
452
+ }
453
+ else if (typeof propertyValue === 'string') {
454
+ editFields.push({ ...baseEditField, editType: 'string' });
455
+ }
456
+ else if (typeof propertyValue === 'object') {
457
+ handlePropertyLevel(propertyValue, `${previousKeys}${key}.`);
458
+ }
459
+ });
460
+ };
461
+ handlePropertyLevel(this.properties, '');
462
+ this.editFields$.next(editFields);
463
+ this.setModifiedProperties(editFields);
464
+ }
465
+ openSaveButtonDisabledSubscription() {
466
+ this.saveButtonDisabledSubscription = combineLatest([
467
+ this.editFields$,
468
+ this.modifiedProperties$,
469
+ this.connectorName$,
470
+ ])
471
+ .pipe(map(([editFields, modifiedProperties, connectorName]) => {
472
+ const values = editFields.map(field => get(modifiedProperties, field.key));
473
+ const validValues = values.filter(value => Array.isArray(value) ? value.length > 0 : value === 0 || value);
474
+ const invalidProperties = editFields.length !== validValues.length || !connectorName;
475
+ if (invalidProperties) {
476
+ this.stateService.disableSaveButton();
477
+ }
478
+ else {
479
+ this.stateService.enableSaveButton();
480
+ }
481
+ }))
482
+ .subscribe();
483
+ }
484
+ openSaveSubscription() {
485
+ this.saveSubscription = this.stateService.save$.subscribe(() => {
486
+ this.onSave();
487
+ });
488
+ }
489
+ openDeleteSubscription() {
490
+ this.deleteSubscription = this.stateService.delete$.subscribe(() => {
491
+ this.onDelete();
492
+ });
493
+ }
494
+ }
495
+ EditConnectorPropertiesComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.9", ngImport: i0, type: EditConnectorPropertiesComponent, deps: [{ token: ConnectorManagementStateService }], target: i0.ɵɵFactoryTarget.Component });
496
+ EditConnectorPropertiesComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.3.9", type: EditConnectorPropertiesComponent, selector: "valtimo-edit-connector-properties", inputs: { properties: "properties", withDefaults: "withDefaults", showDeleteButton: "showDeleteButton", showSaveButton: "showSaveButton", defaultName: "defaultName" }, outputs: { propertiesSave: "propertiesSave", connectorDelete: "connectorDelete" }, usesOnChanges: true, ngImport: i0, 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=\"edit-fields\"\n *ngIf=\"{editFields: editFields$ | async, disabled: disabled$ | async} as obs\"\n>\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\n *ngTemplateOutlet=\"singleInput; context: {editField: editField, disabled: obs.disabled}\"\n ></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 <v-input\n titleTranslationKey=\"connectorManagement.inputLabels.connectorName\"\n [defaultValue]=\"withDefaults && defaultName ? defaultName : ''\"\n [fullWidth]=\"true\"\n [margin]=\"true\"\n [disabled]=\"disabled\"\n (valueChange)=\"onNameValueChange($event)\"\n ></v-input>\n</ng-template>\n\n<ng-template #singleInput let-editField=\"editField\" let-disabled=\"disabled\">\n <v-input\n *ngIf=\"editField.editType === 'string'\"\n [titleTranslationKey]=\"'connectorManagement.inputLabels.' + editField.key\"\n [defaultValue]=\"withDefaults ? editField.defaultValue : ''\"\n [fullWidth]=\"true\"\n [margin]=\"true\"\n [disabled]=\"disabled\"\n (valueChange)=\"onSingleValueChange($event, editField)\"\n ></v-input>\n <v-input\n *ngIf=\"editField.editType === 'number'\"\n [titleTranslationKey]=\"'connectorManagement.inputLabels.' + editField.key\"\n [defaultValue]=\"withDefaults ? editField.defaultValue : ''\"\n [fullWidth]=\"true\"\n [margin]=\"true\"\n [disabled]=\"disabled\"\n (valueChange)=\"onSingleValueChange($event, editField)\"\n [step]=\"1\"\n [min]=\"0\"\n ></v-input>\n</ng-template>\n\n<ng-template #buttons let-disabled=\"disabled\">\n <div class=\"border-top mt-3 pt-6\" *ngIf=\"showDeleteButton || showSaveButton\">\n <div class=\"button-container\">\n <button\n *ngIf=\"showSaveButton\"\n class=\"btn btn-primary\"\n [disabled]=\"disabled || (saveButtonDisabled$ | async)\"\n (click)=\"onSave()\"\n >\n <i class=\"icon mdi mdi-save mr-1\"></i>\n {{ 'connectorManagement.save' | translate }}\n </button>\n <button\n *ngIf=\"showDeleteButton\"\n class=\"btn btn-danger btn-space\"\n (click)=\"onDelete()\"\n [disabled]=\"disabled\"\n >\n <i class=\"icon mdi mdi-delete mr-1\"></i>\n {{ 'connectorManagement.remove' | translate }}\n </button>\n </div>\n </div>\n</ng-template>\n", 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{flex-flow:row-reverse;width:100%;display:flex;justify-content:space-between}\n"], components: [{ type: MultiValueConnectorPropertyComponent, selector: "valtimo-multi-value-connector-property", inputs: ["editField", "disabled", "defaultValue"], outputs: ["valuesSet"] }, { type: i2$2.InputComponent, selector: "v-input", inputs: ["type", "title", "titleTranslationKey", "defaultValue", "widthPx", "fullWidth", "margin", "disabled", "step", "min"], outputs: ["valueChange"] }], directives: [{ type: i6.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { type: i6.NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet"] }, { type: i6.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }], pipes: { "async": i6.AsyncPipe, "translate": i2$1.TranslatePipe } });
497
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.9", ngImport: i0, type: EditConnectorPropertiesComponent, decorators: [{
498
+ type: Component,
499
+ args: [{ selector: 'valtimo-edit-connector-properties', 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=\"edit-fields\"\n *ngIf=\"{editFields: editFields$ | async, disabled: disabled$ | async} as obs\"\n>\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\n *ngTemplateOutlet=\"singleInput; context: {editField: editField, disabled: obs.disabled}\"\n ></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 <v-input\n titleTranslationKey=\"connectorManagement.inputLabels.connectorName\"\n [defaultValue]=\"withDefaults && defaultName ? defaultName : ''\"\n [fullWidth]=\"true\"\n [margin]=\"true\"\n [disabled]=\"disabled\"\n (valueChange)=\"onNameValueChange($event)\"\n ></v-input>\n</ng-template>\n\n<ng-template #singleInput let-editField=\"editField\" let-disabled=\"disabled\">\n <v-input\n *ngIf=\"editField.editType === 'string'\"\n [titleTranslationKey]=\"'connectorManagement.inputLabels.' + editField.key\"\n [defaultValue]=\"withDefaults ? editField.defaultValue : ''\"\n [fullWidth]=\"true\"\n [margin]=\"true\"\n [disabled]=\"disabled\"\n (valueChange)=\"onSingleValueChange($event, editField)\"\n ></v-input>\n <v-input\n *ngIf=\"editField.editType === 'number'\"\n [titleTranslationKey]=\"'connectorManagement.inputLabels.' + editField.key\"\n [defaultValue]=\"withDefaults ? editField.defaultValue : ''\"\n [fullWidth]=\"true\"\n [margin]=\"true\"\n [disabled]=\"disabled\"\n (valueChange)=\"onSingleValueChange($event, editField)\"\n [step]=\"1\"\n [min]=\"0\"\n ></v-input>\n</ng-template>\n\n<ng-template #buttons let-disabled=\"disabled\">\n <div class=\"border-top mt-3 pt-6\" *ngIf=\"showDeleteButton || showSaveButton\">\n <div class=\"button-container\">\n <button\n *ngIf=\"showSaveButton\"\n class=\"btn btn-primary\"\n [disabled]=\"disabled || (saveButtonDisabled$ | async)\"\n (click)=\"onSave()\"\n >\n <i class=\"icon mdi mdi-save mr-1\"></i>\n {{ 'connectorManagement.save' | translate }}\n </button>\n <button\n *ngIf=\"showDeleteButton\"\n class=\"btn btn-danger btn-space\"\n (click)=\"onDelete()\"\n [disabled]=\"disabled\"\n >\n <i class=\"icon mdi mdi-delete mr-1\"></i>\n {{ 'connectorManagement.remove' | translate }}\n </button>\n </div>\n </div>\n</ng-template>\n", 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{flex-flow:row-reverse;width:100%;display:flex;justify-content:space-between}\n"] }]
500
+ }], ctorParameters: function () { return [{ type: ConnectorManagementStateService }]; }, propDecorators: { properties: [{
501
+ type: Input
502
+ }], withDefaults: [{
503
+ type: Input
504
+ }], showDeleteButton: [{
505
+ type: Input
506
+ }], showSaveButton: [{
507
+ type: Input
508
+ }], defaultName: [{
509
+ type: Input
510
+ }], propertiesSave: [{
511
+ type: Output
512
+ }], connectorDelete: [{
513
+ type: Output
514
+ }] } });
515
+
516
+ const editProductAanvragenConnectorForm = {
517
+ display: 'wizard',
518
+ settings: {
519
+ pdf: {
520
+ id: '1ec0f8ee-6685-5d98-a847-26f67b67d6f0',
521
+ src: 'https://files.form.io/pdf/5692b91fd1028f01000407e3/file/1ec0f8ee-6685-5d98-a847-26f67b67d6f0',
522
+ },
523
+ },
524
+ components: [
525
+ {
526
+ title: 'connectorForm.productaanvraag.step0.title',
527
+ breadcrumbClickable: true,
528
+ buttonSettings: {
529
+ previous: true,
530
+ cancel: true,
531
+ next: true,
532
+ },
533
+ navigateOnEnter: false,
534
+ saveOnEnter: false,
535
+ scrollToTop: false,
536
+ collapsible: false,
537
+ key: 'page0',
538
+ type: 'panel',
539
+ label: 'Page 0',
540
+ input: false,
541
+ tableView: false,
542
+ components: [
543
+ {
544
+ label: 'HTML',
545
+ attrs: [
546
+ {
547
+ attr: '',
548
+ value: '',
549
+ },
550
+ ],
551
+ content: 'connectorForm.productaanvraag.step0.tip',
552
+ refreshOnChange: false,
553
+ key: 'html4',
554
+ type: 'htmlelement',
555
+ input: false,
556
+ tableView: false,
557
+ },
558
+ {
559
+ key: 'productAanvraagTypes',
560
+ type: 'editgrid',
561
+ input: true,
562
+ validate: {
563
+ minLength: 1,
564
+ },
565
+ customClass: 'edit-grid-component',
566
+ components: [
567
+ {
568
+ label: 'connectorForm.productaanvraag.step0.typeMapping.productAanvraagType.label',
569
+ tooltip: 'connectorForm.productaanvraag.step0.typeMapping.productAanvraagType.tooltip',
570
+ tableView: true,
571
+ validate: {
572
+ required: true,
573
+ },
574
+ key: 'productAanvraagType',
575
+ type: 'textfield',
576
+ input: true,
577
+ },
578
+ {
579
+ label: 'connectorForm.productaanvraag.step0.typeMapping.caseDefinitionKey.label',
580
+ widget: 'choicesjs',
581
+ placeholder: 'connectorForm.productaanvraag.step0.typeMapping.caseDefinitionKey.placeholder',
582
+ tableView: true,
583
+ validate: {
584
+ required: true,
585
+ },
586
+ key: 'caseDefinitionKey',
587
+ type: 'select',
588
+ input: true,
589
+ },
590
+ {
591
+ label: 'connectorForm.productaanvraag.step0.typeMapping.processDefinitionKey.label',
592
+ widget: 'choicesjs',
593
+ tableView: true,
594
+ dataSrc: 'custom',
595
+ data: {
596
+ custom: "values = window['productRequestDefinitions'][row.caseDefinitionKey] || []",
597
+ },
598
+ dataType: 'string',
599
+ refreshOn: 'row.caseDefinitionKey',
600
+ clearOnRefresh: true,
601
+ key: 'processDefinitionKey',
602
+ type: 'select',
603
+ input: true,
604
+ validate: {
605
+ required: true,
606
+ },
607
+ placeholder: 'connectorForm.productaanvraag.step0.typeMapping.processDefinitionKey.placeholder',
608
+ },
609
+ ],
610
+ },
611
+ ],
612
+ },
613
+ {
614
+ title: 'connectorForm.productaanvraag.step1.title',
615
+ breadcrumbClickable: true,
616
+ buttonSettings: {
617
+ previous: true,
618
+ cancel: true,
619
+ next: true,
620
+ },
621
+ navigateOnEnter: false,
622
+ saveOnEnter: false,
623
+ scrollToTop: false,
624
+ collapsible: false,
625
+ key: 'page1',
626
+ type: 'panel',
627
+ label: 'Page 1',
628
+ input: false,
629
+ tableView: false,
630
+ components: [
631
+ {
632
+ label: 'HTML',
633
+ attrs: [
634
+ {
635
+ attr: '',
636
+ value: '',
637
+ },
638
+ ],
639
+ content: 'connectorForm.productaanvraag.step1.tip',
640
+ refreshOnChange: false,
641
+ key: 'html',
642
+ type: 'htmlelement',
643
+ input: false,
644
+ tableView: false,
645
+ },
646
+ {
647
+ title: 'connectorForm.productaanvraag.step1.connectors.panelTitle',
648
+ collapsible: false,
649
+ key: 'connectorFormProductaanvraagStep1ConnectorsPanelTitle',
650
+ type: 'panel',
651
+ label: 'Panel',
652
+ input: false,
653
+ tableView: false,
654
+ components: [
655
+ {
656
+ label: 'connectorForm.productaanvraag.step1.connectors.openNotificatieConnector.label',
657
+ widget: 'choicesjs',
658
+ tableView: true,
659
+ dataSrc: 'custom',
660
+ data: {
661
+ custom: "values = window['openNotificatieConnectorNames'] || []",
662
+ },
663
+ dataType: 'string',
664
+ clearOnRefresh: true,
665
+ key: 'openNotificatieConnectionName',
666
+ type: 'select',
667
+ input: true,
668
+ validate: {
669
+ required: true,
670
+ },
671
+ placeholder: 'connectorForm.productaanvraag.step1.connectors.openNotificatieConnector.placeholder',
672
+ },
673
+ {
674
+ label: 'connectorForm.productaanvraag.step1.connectors.objectsApiConnector.label',
675
+ widget: 'choicesjs',
676
+ tableView: true,
677
+ dataSrc: 'custom',
678
+ data: {
679
+ custom: "values = window['objectApiConnectorNames'] || []",
680
+ },
681
+ dataType: 'string',
682
+ clearOnRefresh: true,
683
+ key: 'objectsApiConnectionName',
684
+ type: 'select',
685
+ input: true,
686
+ validate: {
687
+ required: true,
688
+ },
689
+ placeholder: 'connectorForm.productaanvraag.step1.connectors.objectsApiConnector.placeholder',
690
+ },
691
+ ],
692
+ },
693
+ ],
694
+ },
695
+ {
696
+ title: 'connectorForm.productaanvraag.step2.title',
697
+ breadcrumbClickable: true,
698
+ buttonSettings: {
699
+ previous: true,
700
+ cancel: true,
701
+ next: true,
702
+ },
703
+ navigateOnEnter: false,
704
+ saveOnEnter: false,
705
+ scrollToTop: false,
706
+ collapsible: false,
707
+ key: 'page2',
708
+ type: 'panel',
709
+ label: 'Page 2',
710
+ input: false,
711
+ tableView: false,
712
+ components: [
713
+ {
714
+ label: 'HTML',
715
+ attrs: [
716
+ {
717
+ attr: '',
718
+ value: '',
719
+ },
720
+ ],
721
+ content: 'connectorForm.productaanvraag.step2.tip',
722
+ refreshOnChange: false,
723
+ key: 'html3',
724
+ type: 'htmlelement',
725
+ input: false,
726
+ tableView: false,
727
+ },
728
+ {
729
+ title: 'connectorForm.productaanvraag.step2.applicant.panelTitle',
730
+ collapsible: false,
731
+ key: 'connectorFormProductaanvraagstep2ApplicantPanelTitle',
732
+ type: 'panel',
733
+ label: 'Panel',
734
+ input: false,
735
+ tableView: false,
736
+ components: [
737
+ {
738
+ label: 'HTML',
739
+ attrs: [
740
+ {
741
+ attr: '',
742
+ value: '',
743
+ },
744
+ ],
745
+ content: 'connectorForm.productaanvraag.step2.applicant.tip',
746
+ refreshOnChange: false,
747
+ key: 'html5',
748
+ type: 'htmlelement',
749
+ input: false,
750
+ tableView: false,
751
+ },
752
+ {
753
+ label: 'connectorForm.productaanvraag.step2.applicant.roleTypeUrl.label',
754
+ tooltip: 'connectorForm.productaanvraag.step2.applicant.roleTypeUrl.tooltip',
755
+ tableView: true,
756
+ validate: {
757
+ required: true,
758
+ },
759
+ key: 'applicantRoleTypeUrl',
760
+ type: 'textfield',
761
+ input: true,
762
+ },
763
+ ],
764
+ },
765
+ ],
766
+ },
767
+ {
768
+ title: 'connectorForm.productaanvraag.step3.title',
769
+ breadcrumbClickable: true,
770
+ buttonSettings: {
771
+ previous: true,
772
+ cancel: true,
773
+ next: true,
774
+ },
775
+ navigateOnEnter: false,
776
+ saveOnEnter: false,
777
+ scrollToTop: false,
778
+ collapsible: false,
779
+ key: 'page3',
780
+ type: 'panel',
781
+ label: 'Page 3',
782
+ input: false,
783
+ tableView: false,
784
+ components: [
785
+ {
786
+ label: 'HTML',
787
+ attrs: [
788
+ {
789
+ attr: '',
790
+ value: '',
791
+ },
792
+ ],
793
+ content: 'connectorForm.productaanvraag.step3.tip',
794
+ refreshOnChange: false,
795
+ key: 'html6',
796
+ type: 'htmlelement',
797
+ input: false,
798
+ tableView: false,
799
+ },
800
+ {
801
+ label: 'connectorForm.productaanvraag.step3.name',
802
+ tableView: true,
803
+ validate: {
804
+ required: true,
805
+ },
806
+ key: 'connectorName',
807
+ type: 'textfield',
808
+ input: true,
809
+ },
810
+ ],
811
+ },
812
+ ],
813
+ };
814
+
815
+ /*
816
+ * Copyright 2015-2021 Ritense BV, the Netherlands.
817
+ *
818
+ * Licensed under EUPL, Version 1.2 (the "License");
819
+ * you may not use this file except in compliance with the License.
820
+ * You may obtain a copy of the License at
821
+ *
822
+ * https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12
823
+ *
824
+ * Unless required by applicable law or agreed to in writing, software
825
+ * distributed under the License is distributed on an "AS IS" basis,
826
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
827
+ * See the License for the specific language governing permissions and
828
+ * limitations under the License.
829
+ */
830
+ class EditProductAanvragenConnectorComponent {
831
+ constructor(formTranslationService, formMappingService, documentService, translateService, connectorManagementService, stateService) {
832
+ this.formTranslationService = formTranslationService;
833
+ this.formMappingService = formMappingService;
834
+ this.documentService = documentService;
835
+ this.translateService = translateService;
836
+ this.connectorManagementService = connectorManagementService;
837
+ this.stateService = stateService;
838
+ this.showDeleteButton = false;
839
+ this.propertiesSave = new EventEmitter();
840
+ this.connectorDelete = new EventEmitter();
841
+ this.formRefresh$ = new Subject();
842
+ this.formDefinition$ = new BehaviorSubject(undefined);
843
+ this.translatedFormDefinition$ = this.formDefinition$.pipe(map(definition => this.formTranslationService.translateForm(definition)));
844
+ this.caseDefinitionOptions = [];
845
+ this.processDocumentDefinitionOptions = {};
846
+ this.options = {
847
+ disableAlerts: true,
848
+ };
849
+ this.mapCaseDefinitionKeyComponent = (component) => {
850
+ if (component.key === 'caseDefinitionKey') {
851
+ return { ...component, disabled: false, data: { values: this.caseDefinitionOptions } };
852
+ }
853
+ return component;
854
+ };
855
+ }
856
+ ngOnInit() {
857
+ window['productRequestDefinitions'] = {};
858
+ this.openFormDefinitionSubscription();
859
+ this.openDeleteSubscription();
860
+ this.formDefinition$.next(editProductAanvragenConnectorForm);
861
+ this.loadConnectorNames();
862
+ this.loadDefinitions();
863
+ this.stateService.hideModalSaveButton();
864
+ }
865
+ ngOnDestroy() {
866
+ this.formDefinitionSubscription?.unsubscribe();
867
+ this.translateSubscription?.unsubscribe();
868
+ this.deleteSubscription?.unsubscribe();
869
+ }
870
+ onSubmit(event) {
871
+ const submission = event.data;
872
+ const properties = cloneDeep(this.properties);
873
+ properties.objectsApiConnectionName = submission.objectsApiConnectionName;
874
+ properties.openNotificatieConnectionName = submission.openNotificatieConnectionName;
875
+ properties.aanvragerRolTypeUrl = submission.applicantRoleTypeUrl;
876
+ properties.typeMapping = submission.productAanvraagTypes;
877
+ this.propertiesSave.emit({ properties, name: submission.connectorName });
878
+ }
879
+ onDelete() {
880
+ this.stateService.disableInput();
881
+ this.connectorDelete.emit();
882
+ }
883
+ openFormDefinitionSubscription() {
884
+ this.formDefinitionSubscription = combineLatest([
885
+ this.formDefinition$,
886
+ this.translateService.stream('key'),
887
+ ]).subscribe(([form]) => {
888
+ const translatedForm = this.formTranslationService.translateForm(form);
889
+ this.refreshForm({ form: translatedForm });
890
+ });
891
+ }
892
+ prefillForm() {
893
+ const properties = cloneDeep(this.properties);
894
+ const submission = {};
895
+ submission.objectsApiConnectionName = properties.objectsApiConnectionName;
896
+ submission.openNotificatieConnectionName = properties.openNotificatieConnectionName;
897
+ submission.applicantRoleTypeUrl = properties.aanvragerRolTypeUrl;
898
+ submission.productAanvraagTypes = properties.typeMapping;
899
+ submission.connectorName = this.defaultName;
900
+ this.refreshForm({ submission: { data: submission } });
901
+ }
902
+ refreshForm(refreshValue) {
903
+ this.formRefresh$.next(refreshValue);
904
+ }
905
+ loadDefinitions() {
906
+ let documentDefinitions;
907
+ this.documentService
908
+ .getAllDefinitions()
909
+ .pipe(tap(resDocumentDefinitions => (documentDefinitions = resDocumentDefinitions.content)), switchMap(resDocumentDefinitions => combineLatest(resDocumentDefinitions.content.map(definition => this.documentService.findProcessDocumentDefinitions(definition.id.name)))), tap(res => {
910
+ this.caseDefinitionOptions = documentDefinitions.map(documentDefinition => ({
911
+ label: documentDefinition.id.name,
912
+ value: documentDefinition.id.name,
913
+ }));
914
+ documentDefinitions.forEach((documentDefinition, index) => {
915
+ this.processDocumentDefinitionOptions[documentDefinition.id.name] = res[index].map(processDocumentDefinition => processDocumentDefinition.id.processDefinitionKey);
916
+ });
917
+ window['productRequestDefinitions'] = this.processDocumentDefinitionOptions;
918
+ const definitionWithCaseDefinitionOptions = this.formMappingService.mapComponents(this.formDefinition$.getValue(), this.mapCaseDefinitionKeyComponent);
919
+ this.formDefinition$.next(definitionWithCaseDefinitionOptions);
920
+ if (this.properties?.aanvragerRolTypeUrl) {
921
+ this.prefillForm();
922
+ }
923
+ }))
924
+ .subscribe();
925
+ }
926
+ loadConnectorNames() {
927
+ this.connectorManagementService
928
+ .getConnectorTypes()
929
+ .pipe(tap(res => {
930
+ res.forEach(connectorType => {
931
+ if (connectorType.name === 'ObjectsApi') {
932
+ this.loadConnectorNamesByType('objectApiConnectorNames', connectorType.id);
933
+ }
934
+ else if (connectorType.name === 'OpenNotificatie') {
935
+ this.loadConnectorNamesByType('openNotificatieConnectorNames', connectorType.id);
936
+ }
937
+ });
938
+ }))
939
+ .subscribe();
940
+ }
941
+ loadConnectorNamesByType(windowKey, connectorTypeId) {
942
+ this.connectorManagementService
943
+ .getConnectorInstancesByType(connectorTypeId)
944
+ .pipe(map(res => (window[windowKey] = res.content.map(connector => connector.name))))
945
+ .subscribe();
946
+ }
947
+ openDeleteSubscription() {
948
+ this.deleteSubscription = this.stateService.delete$.subscribe(() => {
949
+ this.onDelete();
950
+ });
951
+ }
952
+ }
953
+ EditProductAanvragenConnectorComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.9", ngImport: i0, type: EditProductAanvragenConnectorComponent, deps: [{ token: i1$1.FormTranslationService }, { token: i1$1.FormMappingService }, { token: i2$3.DocumentService }, { token: i2$1.TranslateService }, { token: ConnectorManagementService }, { token: ConnectorManagementStateService }], target: i0.ɵɵFactoryTarget.Component });
954
+ EditProductAanvragenConnectorComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.3.9", type: EditProductAanvragenConnectorComponent, selector: "valtimo-edit-product-aanvragen-connector", inputs: { properties: "properties", defaultName: "defaultName", showDeleteButton: "showDeleteButton" }, outputs: { propertiesSave: "propertiesSave", connectorDelete: "connectorDelete" }, ngImport: i0, 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 [options]=\"options\"\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", 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 ::ng-deep .col-sm-2{flex:0 0 25%;max-width:25%}.edit-product-request ::ng-deep .edit-grid-component>label{display:none}.edit-product-request.has-delete ::ng-deep .list-inline{margin-bottom:-30px}.edit-product-request .btn-danger{position:relative}\n"], components: [{ type: i6$1.FormioComponent, selector: "valtimo-form-io", inputs: ["form", "options", "submission", "formRefresh$"], outputs: ["submit", "change"] }], directives: [{ type: i6.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { type: i6.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { type: i8.DefaultClassDirective, selector: " [ngClass], [ngClass.xs], [ngClass.sm], [ngClass.md], [ngClass.lg], [ngClass.xl], [ngClass.lt-sm], [ngClass.lt-md], [ngClass.lt-lg], [ngClass.lt-xl], [ngClass.gt-xs], [ngClass.gt-sm], [ngClass.gt-md], [ngClass.gt-lg]", inputs: ["ngClass", "ngClass.xs", "ngClass.sm", "ngClass.md", "ngClass.lg", "ngClass.xl", "ngClass.lt-sm", "ngClass.lt-md", "ngClass.lt-lg", "ngClass.lt-xl", "ngClass.gt-xs", "ngClass.gt-sm", "ngClass.gt-md", "ngClass.gt-lg"] }], pipes: { "async": i6.AsyncPipe, "translate": i2$1.TranslatePipe } });
955
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.9", ngImport: i0, type: EditProductAanvragenConnectorComponent, decorators: [{
956
+ type: Component,
957
+ args: [{ selector: 'valtimo-edit-product-aanvragen-connector', 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 [options]=\"options\"\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", 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 ::ng-deep .col-sm-2{flex:0 0 25%;max-width:25%}.edit-product-request ::ng-deep .edit-grid-component>label{display:none}.edit-product-request.has-delete ::ng-deep .list-inline{margin-bottom:-30px}.edit-product-request .btn-danger{position:relative}\n"] }]
958
+ }], ctorParameters: function () { return [{ type: i1$1.FormTranslationService }, { type: i1$1.FormMappingService }, { type: i2$3.DocumentService }, { type: i2$1.TranslateService }, { type: ConnectorManagementService }, { type: ConnectorManagementStateService }]; }, propDecorators: { properties: [{
959
+ type: Input
960
+ }], defaultName: [{
961
+ type: Input
962
+ }], showDeleteButton: [{
963
+ type: Input
964
+ }], propertiesSave: [{
965
+ type: Output
966
+ }], connectorDelete: [{
967
+ type: Output
968
+ }] } });
969
+
970
+ const editTaakConnectorForm = {
971
+ components: [
972
+ {
973
+ label: 'connectorForm.taak.name',
974
+ tableView: false,
975
+ validate: {
976
+ required: true,
977
+ },
978
+ key: 'connectorName',
979
+ type: 'textfield',
980
+ input: true,
981
+ },
982
+ {
983
+ label: 'connectorForm.taak.openNotificatieConnector.label',
984
+ widget: 'choicesjs',
985
+ tableView: false,
986
+ dataSrc: 'custom',
987
+ data: {
988
+ custom: "values = window['openNotificatieConnectorNames'] || []",
989
+ },
990
+ dataType: 'string',
991
+ clearOnRefresh: true,
992
+ key: 'openNotificatieConnectionName',
993
+ type: 'select',
994
+ input: true,
995
+ validate: {
996
+ required: true,
997
+ },
998
+ placeholder: 'connectorForm.taak.openNotificatieConnector.placeholder',
999
+ },
1000
+ {
1001
+ label: 'connectorForm.taak.objectsApiConnector.label',
1002
+ widget: 'choicesjs',
1003
+ tableView: false,
1004
+ dataSrc: 'custom',
1005
+ data: {
1006
+ custom: "values = window['objectApiConnectorNames'] || []",
1007
+ },
1008
+ dataType: 'string',
1009
+ clearOnRefresh: true,
1010
+ key: 'objectsApiConnectionName',
1011
+ type: 'select',
1012
+ input: true,
1013
+ validate: {
1014
+ required: true,
1015
+ },
1016
+ placeholder: 'connectorForm.taak.objectsApiConnector.placeholder',
1017
+ },
1018
+ {
1019
+ key: 'submit',
1020
+ type: 'button',
1021
+ customClass: 'list-inline',
1022
+ leftIcon: 'icon mdi mdi-save mt-1',
1023
+ input: true,
1024
+ label: 'connectorManagement.save',
1025
+ tableView: false,
1026
+ disableOnInvalid: true,
1027
+ },
1028
+ ],
1029
+ };
1030
+
1031
+ /*
1032
+ * Copyright 2015-2022 Ritense BV, the Netherlands.
1033
+ *
1034
+ * Licensed under EUPL, Version 1.2 (the "License");
1035
+ * you may not use this file except in compliance with the License.
1036
+ * You may obtain a copy of the License at
1037
+ *
1038
+ * https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12
1039
+ *
1040
+ * Unless required by applicable law or agreed to in writing, software
1041
+ * distributed under the License is distributed on an "AS IS" basis,
1042
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1043
+ * See the License for the specific language governing permissions and
1044
+ * limitations under the License.
1045
+ */
1046
+ class EditTaakConnectorComponent {
1047
+ constructor(formTranslationService, formMappingService, translateService, connectorManagementService, stateService) {
1048
+ this.formTranslationService = formTranslationService;
1049
+ this.formMappingService = formMappingService;
1050
+ this.translateService = translateService;
1051
+ this.connectorManagementService = connectorManagementService;
1052
+ this.stateService = stateService;
1053
+ this.showDeleteButton = false;
1054
+ this.propertiesSave = new EventEmitter();
1055
+ this.connectorDelete = new EventEmitter();
1056
+ this.formRefresh$ = new Subject();
1057
+ this.formDefinition$ = new BehaviorSubject(undefined);
1058
+ this.translatedFormDefinition$ = this.formDefinition$.pipe(map(definition => this.formTranslationService.translateForm(definition)));
1059
+ this.options = {
1060
+ disableAlerts: true,
1061
+ };
1062
+ }
1063
+ ngOnInit() {
1064
+ this.openFormDefinitionSubscription();
1065
+ this.openDeleteSubscription();
1066
+ this.formDefinition$.next(editTaakConnectorForm);
1067
+ this.loadConnectorNames();
1068
+ this.prefillForm();
1069
+ this.stateService.hideModalSaveButton();
1070
+ }
1071
+ ngOnDestroy() {
1072
+ this.formDefinitionSubscription?.unsubscribe();
1073
+ this.translateSubscription?.unsubscribe();
1074
+ this.deleteSubscription?.unsubscribe();
1075
+ }
1076
+ onSubmit(event) {
1077
+ const submission = event.data;
1078
+ const properties = cloneDeep(this.properties);
1079
+ properties.objectsApiConnectionName = submission.objectsApiConnectionName;
1080
+ properties.openNotificatieConnectionName = submission.openNotificatieConnectionName;
1081
+ this.propertiesSave.emit({ properties, name: submission.connectorName });
1082
+ }
1083
+ onDelete() {
1084
+ this.stateService.disableInput();
1085
+ this.connectorDelete.emit();
1086
+ }
1087
+ openFormDefinitionSubscription() {
1088
+ this.formDefinitionSubscription = combineLatest([
1089
+ this.formDefinition$,
1090
+ this.translateService.stream('key'),
1091
+ ]).subscribe(([form]) => {
1092
+ const translatedForm = this.formTranslationService.translateForm(form);
1093
+ this.refreshForm({ form: translatedForm });
1094
+ });
1095
+ }
1096
+ prefillForm() {
1097
+ timer(100)
1098
+ .pipe(tap(() => {
1099
+ if (this.defaultName !== undefined) {
1100
+ const properties = cloneDeep(this.properties);
1101
+ const submission = {};
1102
+ submission.objectsApiConnectionName = properties.objectsApiConnectionName;
1103
+ submission.openNotificatieConnectionName = properties.openNotificatieConnectionName;
1104
+ submission.connectorName = this.defaultName;
1105
+ this.refreshForm({ submission: { data: submission } });
1106
+ }
1107
+ }))
1108
+ .subscribe();
1109
+ }
1110
+ refreshForm(refreshValue) {
1111
+ this.formRefresh$.next(refreshValue);
1112
+ }
1113
+ loadConnectorNames() {
1114
+ this.connectorManagementService
1115
+ .getConnectorTypes()
1116
+ .pipe(tap(res => {
1117
+ res.forEach(connectorType => {
1118
+ if (connectorType.name === 'ObjectsApi') {
1119
+ this.loadConnectorNamesByType('objectApiConnectorNames', connectorType.id);
1120
+ }
1121
+ else if (connectorType.name === 'OpenNotificatie') {
1122
+ this.loadConnectorNamesByType('openNotificatieConnectorNames', connectorType.id);
1123
+ }
1124
+ });
1125
+ }))
1126
+ .subscribe();
1127
+ }
1128
+ loadConnectorNamesByType(windowKey, connectorTypeId) {
1129
+ this.connectorManagementService
1130
+ .getConnectorInstancesByType(connectorTypeId)
1131
+ .pipe(map(res => (window[windowKey] = res.content.map(connector => connector.name))))
1132
+ .subscribe();
1133
+ }
1134
+ openDeleteSubscription() {
1135
+ this.deleteSubscription = this.stateService.delete$.subscribe(() => {
1136
+ this.onDelete();
1137
+ });
1138
+ }
1139
+ }
1140
+ EditTaakConnectorComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.9", ngImport: i0, type: EditTaakConnectorComponent, deps: [{ token: i1$1.FormTranslationService }, { token: i1$1.FormMappingService }, { token: i2$1.TranslateService }, { token: ConnectorManagementService }, { token: ConnectorManagementStateService }], target: i0.ɵɵFactoryTarget.Component });
1141
+ EditTaakConnectorComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.3.9", type: EditTaakConnectorComponent, selector: "valtimo-edit-taak-connector", inputs: { properties: "properties", defaultName: "defaultName", showDeleteButton: "showDeleteButton" }, outputs: { propertiesSave: "propertiesSave", connectorDelete: "connectorDelete" }, ngImport: i0, template: "<!--\n ~ Copyright 2015-2022 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-taak\"\n [ngClass]=\"{'has-delete': showDeleteButton}\"\n>\n <valtimo-form-io\n [form]=\"definition\"\n [formRefresh$]=\"formRefresh$\"\n [options]=\"options\"\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", styles: ["/*!\n * Copyright 2015-2022 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-taak ::ng-deep .list-inline{display:flex;flex-direction:row;justify-content:flex-end}.edit-taak .btn-danger{position:absolute;bottom:35px}\n"], components: [{ type: i6$1.FormioComponent, selector: "valtimo-form-io", inputs: ["form", "options", "submission", "formRefresh$"], outputs: ["submit", "change"] }], directives: [{ type: i6.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { type: i6.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { type: i8.DefaultClassDirective, selector: " [ngClass], [ngClass.xs], [ngClass.sm], [ngClass.md], [ngClass.lg], [ngClass.xl], [ngClass.lt-sm], [ngClass.lt-md], [ngClass.lt-lg], [ngClass.lt-xl], [ngClass.gt-xs], [ngClass.gt-sm], [ngClass.gt-md], [ngClass.gt-lg]", inputs: ["ngClass", "ngClass.xs", "ngClass.sm", "ngClass.md", "ngClass.lg", "ngClass.xl", "ngClass.lt-sm", "ngClass.lt-md", "ngClass.lt-lg", "ngClass.lt-xl", "ngClass.gt-xs", "ngClass.gt-sm", "ngClass.gt-md", "ngClass.gt-lg"] }], pipes: { "async": i6.AsyncPipe, "translate": i2$1.TranslatePipe } });
1142
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.9", ngImport: i0, type: EditTaakConnectorComponent, decorators: [{
1143
+ type: Component,
1144
+ args: [{ selector: 'valtimo-edit-taak-connector', template: "<!--\n ~ Copyright 2015-2022 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-taak\"\n [ngClass]=\"{'has-delete': showDeleteButton}\"\n>\n <valtimo-form-io\n [form]=\"definition\"\n [formRefresh$]=\"formRefresh$\"\n [options]=\"options\"\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", styles: ["/*!\n * Copyright 2015-2022 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-taak ::ng-deep .list-inline{display:flex;flex-direction:row;justify-content:flex-end}.edit-taak .btn-danger{position:absolute;bottom:35px}\n"] }]
1145
+ }], ctorParameters: function () { return [{ type: i1$1.FormTranslationService }, { type: i1$1.FormMappingService }, { type: i2$1.TranslateService }, { type: ConnectorManagementService }, { type: ConnectorManagementStateService }]; }, propDecorators: { properties: [{
1146
+ type: Input
1147
+ }], defaultName: [{
1148
+ type: Input
1149
+ }], showDeleteButton: [{
1150
+ type: Input
1151
+ }], propertiesSave: [{
1152
+ type: Output
1153
+ }], connectorDelete: [{
1154
+ type: Output
1155
+ }] } });
1156
+
1157
+ /*
1158
+ * Copyright 2015-2020 Ritense BV, the Netherlands.
1159
+ *
1160
+ * Licensed under EUPL, Version 1.2 (the "License");
1161
+ * you may not use this file except in compliance with the License.
1162
+ * You may obtain a copy of the License at
1163
+ *
1164
+ * https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12
1165
+ *
1166
+ * Unless required by applicable law or agreed to in writing, software
1167
+ * distributed under the License is distributed on an "AS IS" basis,
1168
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1169
+ * See the License for the specific language governing permissions and
1170
+ * limitations under the License.
1171
+ */
1172
+ class EditConnectorFormComponent {
1173
+ constructor() {
1174
+ this.withDefaults = false;
1175
+ this.showDeleteButton = false;
1176
+ this.showSaveButton = true;
1177
+ this.propertiesSave = new EventEmitter();
1178
+ this.connectorDelete = new EventEmitter();
1179
+ this.productAanvragenName = 'ProductAanvragen';
1180
+ this.taakName = 'Taak';
1181
+ this.customConnectorNames = [this.productAanvragenName, this.taakName];
1182
+ }
1183
+ }
1184
+ EditConnectorFormComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.9", ngImport: i0, type: EditConnectorFormComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
1185
+ EditConnectorFormComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.3.9", type: EditConnectorFormComponent, selector: "valtimo-edit-connector-form", inputs: { properties: "properties", withDefaults: "withDefaults", showDeleteButton: "showDeleteButton", showSaveButton: "showSaveButton", defaultName: "defaultName", connectorName: "connectorName" }, outputs: { propertiesSave: "propertiesSave", connectorDelete: "connectorDelete" }, ngImport: i0, 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=\"!customConnectorNames.includes(connectorName)\"\n [properties]=\"properties\"\n [withDefaults]=\"withDefaults\"\n [defaultName]=\"defaultName\"\n [showDeleteButton]=\"showDeleteButton\"\n (propertiesSave)=\"propertiesSave.emit($event)\"\n (connectorDelete)=\"connectorDelete.emit()\"\n [showSaveButton]=\"showSaveButton\"\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\n<valtimo-edit-taak-connector\n *ngIf=\"connectorName === taakName\"\n [defaultName]=\"defaultName\"\n [properties]=\"properties\"\n [showDeleteButton]=\"showDeleteButton\"\n (propertiesSave)=\"propertiesSave.emit($event)\"\n (connectorDelete)=\"connectorDelete.emit()\"\n>\n</valtimo-edit-taak-connector>\n", 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 */\n"], components: [{ type: EditConnectorPropertiesComponent, selector: "valtimo-edit-connector-properties", inputs: ["properties", "withDefaults", "showDeleteButton", "showSaveButton", "defaultName"], outputs: ["propertiesSave", "connectorDelete"] }, { type: EditProductAanvragenConnectorComponent, selector: "valtimo-edit-product-aanvragen-connector", inputs: ["properties", "defaultName", "showDeleteButton"], outputs: ["propertiesSave", "connectorDelete"] }, { type: EditTaakConnectorComponent, selector: "valtimo-edit-taak-connector", inputs: ["properties", "defaultName", "showDeleteButton"], outputs: ["propertiesSave", "connectorDelete"] }], directives: [{ type: i6.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }] });
1186
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.9", ngImport: i0, type: EditConnectorFormComponent, decorators: [{
1187
+ type: Component,
1188
+ args: [{ selector: 'valtimo-edit-connector-form', 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=\"!customConnectorNames.includes(connectorName)\"\n [properties]=\"properties\"\n [withDefaults]=\"withDefaults\"\n [defaultName]=\"defaultName\"\n [showDeleteButton]=\"showDeleteButton\"\n (propertiesSave)=\"propertiesSave.emit($event)\"\n (connectorDelete)=\"connectorDelete.emit()\"\n [showSaveButton]=\"showSaveButton\"\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\n<valtimo-edit-taak-connector\n *ngIf=\"connectorName === taakName\"\n [defaultName]=\"defaultName\"\n [properties]=\"properties\"\n [showDeleteButton]=\"showDeleteButton\"\n (propertiesSave)=\"propertiesSave.emit($event)\"\n (connectorDelete)=\"connectorDelete.emit()\"\n>\n</valtimo-edit-taak-connector>\n", 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 */\n"] }]
1189
+ }], propDecorators: { properties: [{
1190
+ type: Input
1191
+ }], withDefaults: [{
1192
+ type: Input
1193
+ }], showDeleteButton: [{
1194
+ type: Input
1195
+ }], showSaveButton: [{
1196
+ type: Input
1197
+ }], defaultName: [{
1198
+ type: Input
1199
+ }], connectorName: [{
1200
+ type: Input
1201
+ }], propertiesSave: [{
1202
+ type: Output
1203
+ }], connectorDelete: [{
1204
+ type: Output
1205
+ }] } });
1206
+
1207
+ /*
1208
+ * Copyright 2015-2020 Ritense BV, the Netherlands.
1209
+ *
1210
+ * Licensed under EUPL, Version 1.2 (the "License");
1211
+ * you may not use this file except in compliance with the License.
1212
+ * You may obtain a copy of the License at
1213
+ *
1214
+ * https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12
1215
+ *
1216
+ * Unless required by applicable law or agreed to in writing, software
1217
+ * distributed under the License is distributed on an "AS IS" basis,
1218
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1219
+ * See the License for the specific language governing permissions and
1220
+ * limitations under the License.
1221
+ */
1222
+ class ModifyConnectorComponent {
1223
+ constructor(connectorManagementService, stateService, alertService, translateService) {
1224
+ this.connectorManagementService = connectorManagementService;
1225
+ this.stateService = stateService;
1226
+ this.alertService = alertService;
1227
+ this.translateService = translateService;
1228
+ this.showSaveButton = true;
1229
+ this.showDeleteButton = true;
1230
+ this.instance$ = this.stateService.selectedInstance$;
1231
+ }
1232
+ onSave(event) {
1233
+ this.stateService.disableInput();
1234
+ this.instance$.pipe(take(1)).subscribe(instance => {
1235
+ this.connectorManagementService
1236
+ .updateConnectorInstance({
1237
+ name: event.name,
1238
+ typeId: instance.type.id,
1239
+ id: instance.id,
1240
+ connectorProperties: event.properties,
1241
+ })
1242
+ .subscribe(() => {
1243
+ this.alertService.success(this.translateService.instant('connectorManagement.messages.modifySuccess'));
1244
+ this.stateService.hideModal();
1245
+ this.stateService.enableInput();
1246
+ this.stateService.refresh();
1247
+ }, () => {
1248
+ this.stateService.enableInput();
1249
+ });
1250
+ });
1251
+ }
1252
+ onDelete() {
1253
+ this.stateService.disableInput();
1254
+ this.instance$.pipe(take(1)).subscribe(instance => {
1255
+ this.connectorManagementService.deleteConnectorInstance(instance.id).subscribe(() => {
1256
+ this.alertService.success(this.translateService.instant('connectorManagement.messages.deleteSuccess'));
1257
+ this.stateService.hideModal();
1258
+ this.stateService.enableInput();
1259
+ this.stateService.refresh();
1260
+ }, () => {
1261
+ this.stateService.enableInput();
1262
+ });
1263
+ });
1264
+ }
1265
+ }
1266
+ ModifyConnectorComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.9", ngImport: i0, type: ModifyConnectorComponent, deps: [{ token: ConnectorManagementService }, { token: ConnectorManagementStateService }, { token: i6$1.AlertService }, { token: i2$1.TranslateService }], target: i0.ɵɵFactoryTarget.Component });
1267
+ ModifyConnectorComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.3.9", type: ModifyConnectorComponent, selector: "valtimo-modify-connector", inputs: { showSaveButton: "showSaveButton", showDeleteButton: "showDeleteButton" }, ngImport: i0, 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-form\n *ngIf=\"instance$ | async as instance\"\n [properties]=\"instance.properties\"\n [withDefaults]=\"true\"\n [defaultName]=\"instance.name\"\n [showDeleteButton]=\"showDeleteButton\"\n [connectorName]=\"instance.type.name\"\n [showSaveButton]=\"showSaveButton\"\n (propertiesSave)=\"onSave($event)\"\n (connectorDelete)=\"onDelete()\"\n>\n</valtimo-edit-connector-form>\n", 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 */\n"], components: [{ type: EditConnectorFormComponent, selector: "valtimo-edit-connector-form", inputs: ["properties", "withDefaults", "showDeleteButton", "showSaveButton", "defaultName", "connectorName"], outputs: ["propertiesSave", "connectorDelete"] }], directives: [{ type: i6.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }], pipes: { "async": i6.AsyncPipe } });
1268
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.9", ngImport: i0, type: ModifyConnectorComponent, decorators: [{
1269
+ type: Component,
1270
+ args: [{ selector: 'valtimo-modify-connector', 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-form\n *ngIf=\"instance$ | async as instance\"\n [properties]=\"instance.properties\"\n [withDefaults]=\"true\"\n [defaultName]=\"instance.name\"\n [showDeleteButton]=\"showDeleteButton\"\n [connectorName]=\"instance.type.name\"\n [showSaveButton]=\"showSaveButton\"\n (propertiesSave)=\"onSave($event)\"\n (connectorDelete)=\"onDelete()\"\n>\n</valtimo-edit-connector-form>\n", 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 */\n"] }]
1271
+ }], ctorParameters: function () { return [{ type: ConnectorManagementService }, { type: ConnectorManagementStateService }, { type: i6$1.AlertService }, { type: i2$1.TranslateService }]; }, propDecorators: { showSaveButton: [{
1272
+ type: Input
1273
+ }], showDeleteButton: [{
1274
+ type: Input
1275
+ }] } });
1276
+
1277
+ /*
1278
+ * Copyright 2015-2020 Ritense BV, the Netherlands.
1279
+ *
1280
+ * Licensed under EUPL, Version 1.2 (the "License");
1281
+ * you may not use this file except in compliance with the License.
1282
+ * You may obtain a copy of the License at
1283
+ *
1284
+ * https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12
1285
+ *
1286
+ * Unless required by applicable law or agreed to in writing, software
1287
+ * distributed under the License is distributed on an "AS IS" basis,
1288
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1289
+ * See the License for the specific language governing permissions and
1290
+ * limitations under the License.
1291
+ */
1292
+ class AddConnectorSelectComponent {
1293
+ constructor(connectorManagementService, stateService, translateService) {
1294
+ this.connectorManagementService = connectorManagementService;
1295
+ this.stateService = stateService;
1296
+ this.translateService = translateService;
1297
+ this.selectedConnector$ = this.stateService.selectedConnector$;
1298
+ this.disabled$ = this.stateService.inputDisabled$;
1299
+ this.connectorTypes$ = this.stateService.connectorTypes$;
1300
+ }
1301
+ ngOnInit() {
1302
+ this.openRefreshSubscription();
1303
+ this.getConnectorTypes();
1304
+ }
1305
+ ngOnDestroy() {
1306
+ this.refreshSubscription?.unsubscribe();
1307
+ }
1308
+ selectConnector(connectorType) {
1309
+ this.stateService.setSelectedConnectorType(connectorType);
1310
+ }
1311
+ deselectConnector() {
1312
+ this.stateService.clearSelectedConnector();
1313
+ }
1314
+ getConnectorTypes() {
1315
+ this.connectorManagementService.getConnectorTypes().subscribe(connectorTypes => {
1316
+ this.stateService.setConnectorTypes(connectorTypes);
1317
+ });
1318
+ }
1319
+ openRefreshSubscription() {
1320
+ this.refreshSubscription = combineLatest([
1321
+ this.stateService.showModal$,
1322
+ this.stateService.refresh$,
1323
+ ]).subscribe(() => {
1324
+ this.deselectConnector();
1325
+ });
1326
+ }
1327
+ }
1328
+ AddConnectorSelectComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.9", ngImport: i0, type: AddConnectorSelectComponent, deps: [{ token: ConnectorManagementService }, { token: ConnectorManagementStateService }, { token: i2$1.TranslateService }], target: i0.ɵɵFactoryTarget.Component });
1329
+ AddConnectorSelectComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.3.9", type: AddConnectorSelectComponent, selector: "valtimo-add-connector-select", ngImport: i0, 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 <div fxLayout=\"row wrap\" fxLayoutGap=\"22px grid\">\n <div fxFlex=\"33.3%\" *ngFor=\"let connectorType of connectorTypes\">\n <v-card\n [titleTranslationKey]=\"'connector.' + connectorType.name + '.title'\"\n [descriptionTranslationKey]=\"'connector.' + connectorType.name + '.description'\"\n [selectable]=\"true\"\n [selected]=\"(selectedConnector$ | async)?.name === connectorType.name\"\n [fullHeight]=\"true\"\n (selectEvent)=\"selectConnector(connectorType)\"\n (deselectEvent)=\"deselectConnector()\"\n ></v-card>\n </div>\n </div>\n</ng-container>\n\n<ng-template #loading>\n <div fxLayout=\"row wrap\" fxLayoutGap=\"22px grid\">\n <ng-container *ngTemplateOutlet=\"loadingCard\"></ng-container>\n <ng-container *ngTemplateOutlet=\"loadingCard\"></ng-container>\n <ng-container *ngTemplateOutlet=\"loadingCard\"></ng-container>\n </div>\n</ng-template>\n\n<ng-template #loadingCard>\n <div fxFlex=\"33.3%\">\n <v-card [loading]=\"true\" [loadingDescription]=\"true\" [loadingTitle]=\"true\"></v-card>\n </div>\n</ng-template>\n", 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{width:calc(33.3% - 20px);margin-right:30px}.card:nth-child(3n+3){margin-right:0}.card-header{white-space:nowrap;overflow:hidden;text-overflow:ellipsis}\n"], components: [{ type: i2$2.CardComponent, selector: "v-card", inputs: ["titleTranslationKey", "title", "descriptionTranslationKey", "description", "selectable", "selected", "fullHeight", "loading", "loadingTitle", "loadingDescription"], outputs: ["selectEvent", "deselectEvent"] }], directives: [{ type: i6.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { type: i6$2.DefaultLayoutDirective, selector: " [fxLayout], [fxLayout.xs], [fxLayout.sm], [fxLayout.md], [fxLayout.lg], [fxLayout.xl], [fxLayout.lt-sm], [fxLayout.lt-md], [fxLayout.lt-lg], [fxLayout.lt-xl], [fxLayout.gt-xs], [fxLayout.gt-sm], [fxLayout.gt-md], [fxLayout.gt-lg]", inputs: ["fxLayout", "fxLayout.xs", "fxLayout.sm", "fxLayout.md", "fxLayout.lg", "fxLayout.xl", "fxLayout.lt-sm", "fxLayout.lt-md", "fxLayout.lt-lg", "fxLayout.lt-xl", "fxLayout.gt-xs", "fxLayout.gt-sm", "fxLayout.gt-md", "fxLayout.gt-lg"] }, { type: i6$2.DefaultLayoutGapDirective, selector: " [fxLayoutGap], [fxLayoutGap.xs], [fxLayoutGap.sm], [fxLayoutGap.md], [fxLayoutGap.lg], [fxLayoutGap.xl], [fxLayoutGap.lt-sm], [fxLayoutGap.lt-md], [fxLayoutGap.lt-lg], [fxLayoutGap.lt-xl], [fxLayoutGap.gt-xs], [fxLayoutGap.gt-sm], [fxLayoutGap.gt-md], [fxLayoutGap.gt-lg]", inputs: ["fxLayoutGap", "fxLayoutGap.xs", "fxLayoutGap.sm", "fxLayoutGap.md", "fxLayoutGap.lg", "fxLayoutGap.xl", "fxLayoutGap.lt-sm", "fxLayoutGap.lt-md", "fxLayoutGap.lt-lg", "fxLayoutGap.lt-xl", "fxLayoutGap.gt-xs", "fxLayoutGap.gt-sm", "fxLayoutGap.gt-md", "fxLayoutGap.gt-lg"] }, { type: i6.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { type: i6$2.DefaultFlexDirective, selector: " [fxFlex], [fxFlex.xs], [fxFlex.sm], [fxFlex.md], [fxFlex.lg], [fxFlex.xl], [fxFlex.lt-sm], [fxFlex.lt-md], [fxFlex.lt-lg], [fxFlex.lt-xl], [fxFlex.gt-xs], [fxFlex.gt-sm], [fxFlex.gt-md], [fxFlex.gt-lg]", inputs: ["fxFlex", "fxFlex.xs", "fxFlex.sm", "fxFlex.md", "fxFlex.lg", "fxFlex.xl", "fxFlex.lt-sm", "fxFlex.lt-md", "fxFlex.lt-lg", "fxFlex.lt-xl", "fxFlex.gt-xs", "fxFlex.gt-sm", "fxFlex.gt-md", "fxFlex.gt-lg"] }, { type: i6.NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet"] }], pipes: { "async": i6.AsyncPipe } });
1330
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.9", ngImport: i0, type: AddConnectorSelectComponent, decorators: [{
1331
+ type: Component,
1332
+ args: [{ selector: 'valtimo-add-connector-select', 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 <div fxLayout=\"row wrap\" fxLayoutGap=\"22px grid\">\n <div fxFlex=\"33.3%\" *ngFor=\"let connectorType of connectorTypes\">\n <v-card\n [titleTranslationKey]=\"'connector.' + connectorType.name + '.title'\"\n [descriptionTranslationKey]=\"'connector.' + connectorType.name + '.description'\"\n [selectable]=\"true\"\n [selected]=\"(selectedConnector$ | async)?.name === connectorType.name\"\n [fullHeight]=\"true\"\n (selectEvent)=\"selectConnector(connectorType)\"\n (deselectEvent)=\"deselectConnector()\"\n ></v-card>\n </div>\n </div>\n</ng-container>\n\n<ng-template #loading>\n <div fxLayout=\"row wrap\" fxLayoutGap=\"22px grid\">\n <ng-container *ngTemplateOutlet=\"loadingCard\"></ng-container>\n <ng-container *ngTemplateOutlet=\"loadingCard\"></ng-container>\n <ng-container *ngTemplateOutlet=\"loadingCard\"></ng-container>\n </div>\n</ng-template>\n\n<ng-template #loadingCard>\n <div fxFlex=\"33.3%\">\n <v-card [loading]=\"true\" [loadingDescription]=\"true\" [loadingTitle]=\"true\"></v-card>\n </div>\n</ng-template>\n", 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{width:calc(33.3% - 20px);margin-right:30px}.card:nth-child(3n+3){margin-right:0}.card-header{white-space:nowrap;overflow:hidden;text-overflow:ellipsis}\n"] }]
1333
+ }], ctorParameters: function () { return [{ type: ConnectorManagementService }, { type: ConnectorManagementStateService }, { type: i2$1.TranslateService }]; } });
1334
+
1335
+ /*
1336
+ * Copyright 2015-2020 Ritense BV, the Netherlands.
1337
+ *
1338
+ * Licensed under EUPL, Version 1.2 (the "License");
1339
+ * you may not use this file except in compliance with the License.
1340
+ * You may obtain a copy of the License at
1341
+ *
1342
+ * https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12
1343
+ *
1344
+ * Unless required by applicable law or agreed to in writing, software
1345
+ * distributed under the License is distributed on an "AS IS" basis,
1346
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1347
+ * See the License for the specific language governing permissions and
1348
+ * limitations under the License.
1349
+ */
1350
+ class AddConnectorConfigureComponent {
1351
+ constructor(connectorManagementService, stateService, alertService, translateService) {
1352
+ this.connectorManagementService = connectorManagementService;
1353
+ this.stateService = stateService;
1354
+ this.alertService = alertService;
1355
+ this.translateService = translateService;
1356
+ this.showSaveButton = true;
1357
+ this.selectedConnector$ = this.stateService.selectedConnector$;
1358
+ this.disabled$ = this.stateService.inputDisabled$;
1359
+ this.connectorTypes$ = this.stateService.connectorTypes$;
1360
+ }
1361
+ selectConnector(connectorType) {
1362
+ this.stateService.setSelectedConnectorType(connectorType);
1363
+ }
1364
+ onSave(event) {
1365
+ this.stateService.disableInput();
1366
+ this.selectedConnector$.pipe(take(1)).subscribe(selectedConnectorType => {
1367
+ this.connectorManagementService
1368
+ .createConnectorInstance({
1369
+ name: event.name,
1370
+ typeId: selectedConnectorType.id,
1371
+ connectorProperties: event.properties,
1372
+ })
1373
+ .subscribe(() => {
1374
+ this.alertService.success(this.translateService.instant('connectorManagement.messages.addSuccess'));
1375
+ this.stateService.hideModal();
1376
+ this.stateService.enableInput();
1377
+ this.stateService.refresh();
1378
+ }, () => {
1379
+ this.stateService.enableInput();
1380
+ });
1381
+ });
1382
+ }
1383
+ }
1384
+ AddConnectorConfigureComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.9", ngImport: i0, type: AddConnectorConfigureComponent, deps: [{ token: ConnectorManagementService }, { token: ConnectorManagementStateService }, { token: i6$1.AlertService }, { token: i2$1.TranslateService }], target: i0.ɵɵFactoryTarget.Component });
1385
+ AddConnectorConfigureComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.3.9", type: AddConnectorConfigureComponent, selector: "valtimo-add-connector-configure", inputs: { showSaveButton: "showSaveButton" }, ngImport: i0, 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-form\n *ngIf=\"selectedConnector$ | async as connector\"\n [connectorName]=\"connector.name\"\n [properties]=\"(selectedConnector$ | async).properties\"\n (propertiesSave)=\"onSave($event)\"\n [showSaveButton]=\"showSaveButton\"\n>\n</valtimo-edit-connector-form>\n", 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{width:calc(33.3% - 20px);margin-right:30px}.card:nth-child(3n+3){margin-right:0}.card-header{white-space:nowrap;overflow:hidden;text-overflow:ellipsis}\n"], components: [{ type: EditConnectorFormComponent, selector: "valtimo-edit-connector-form", inputs: ["properties", "withDefaults", "showDeleteButton", "showSaveButton", "defaultName", "connectorName"], outputs: ["propertiesSave", "connectorDelete"] }], directives: [{ type: i6.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }], pipes: { "async": i6.AsyncPipe } });
1386
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.9", ngImport: i0, type: AddConnectorConfigureComponent, decorators: [{
1387
+ type: Component,
1388
+ args: [{ selector: 'valtimo-add-connector-configure', 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-form\n *ngIf=\"selectedConnector$ | async as connector\"\n [connectorName]=\"connector.name\"\n [properties]=\"(selectedConnector$ | async).properties\"\n (propertiesSave)=\"onSave($event)\"\n [showSaveButton]=\"showSaveButton\"\n>\n</valtimo-edit-connector-form>\n", 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{width:calc(33.3% - 20px);margin-right:30px}.card:nth-child(3n+3){margin-right:0}.card-header{white-space:nowrap;overflow:hidden;text-overflow:ellipsis}\n"] }]
1389
+ }], ctorParameters: function () { return [{ type: ConnectorManagementService }, { type: ConnectorManagementStateService }, { type: i6$1.AlertService }, { type: i2$1.TranslateService }]; }, propDecorators: { showSaveButton: [{
1390
+ type: Input
1391
+ }] } });
1392
+
1393
+ /*
1394
+ * Copyright 2015-2020 Ritense BV, the Netherlands.
1395
+ *
1396
+ * Licensed under EUPL, Version 1.2 (the "License");
1397
+ * you may not use this file except in compliance with the License.
1398
+ * You may obtain a copy of the License at
1399
+ *
1400
+ * https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12
1401
+ *
1402
+ * Unless required by applicable law or agreed to in writing, software
1403
+ * distributed under the License is distributed on an "AS IS" basis,
1404
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1405
+ * See the License for the specific language governing permissions and
1406
+ * limitations under the License.
1407
+ */
1408
+ class ConnectorModalComponent {
1409
+ constructor(stateService, modalService) {
1410
+ this.stateService = stateService;
1411
+ this.modalService = modalService;
1412
+ this.connectorTypeSelected$ = this.stateService.selectedConnector$;
1413
+ this.saveButtonDisabled$ = this.stateService.saveButtonDisabled$;
1414
+ this.inputDisabled$ = this.stateService.inputDisabled$;
1415
+ this.hideModalSaveButton$ = this.stateService.hideModalSaveButton$;
1416
+ this.returnToFirstStepSubject$ = new Subject();
1417
+ }
1418
+ ngAfterViewInit() {
1419
+ this.openShowSubscription();
1420
+ this.openHideSubscription();
1421
+ }
1422
+ ngOnDestroy() {
1423
+ this.showSubscription?.unsubscribe();
1424
+ this.hideSubscription?.unsubscribe();
1425
+ }
1426
+ hide() {
1427
+ this.stateService.disableInput();
1428
+ this.modalService.closeModal();
1429
+ this.modalService.appearingDelayMs$.pipe(take(1)).subscribe(appearingDelay => {
1430
+ setTimeout(() => {
1431
+ this.returnToFirstStep();
1432
+ this.stateService.enableInput();
1433
+ this.stateService.clearSelectedConnector();
1434
+ }, appearingDelay);
1435
+ });
1436
+ }
1437
+ complete() {
1438
+ this.stateService.save();
1439
+ }
1440
+ delete() {
1441
+ this.stateService.delete();
1442
+ }
1443
+ openShowSubscription() {
1444
+ this.showSubscription = this.stateService.showModal$.subscribe(() => {
1445
+ this.show();
1446
+ });
1447
+ }
1448
+ openHideSubscription() {
1449
+ this.hideSubscription = this.stateService.hideModal$.subscribe(() => {
1450
+ this.hide();
1451
+ });
1452
+ }
1453
+ returnToFirstStep() {
1454
+ this.returnToFirstStepSubject$.next(true);
1455
+ }
1456
+ show() {
1457
+ this.stateService.modalType$.pipe(take(1)).subscribe(modalType => {
1458
+ if (modalType === 'add') {
1459
+ this.modalService.openModal(this.connectorCreateModal);
1460
+ }
1461
+ else if (modalType === 'modify') {
1462
+ this.modalService.openModal(this.connectorEditModal);
1463
+ }
1464
+ });
1465
+ }
1466
+ }
1467
+ ConnectorModalComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.9", ngImport: i0, type: ConnectorModalComponent, deps: [{ token: ConnectorManagementStateService }, { token: i2$2.ModalService }], target: i0.ɵɵFactoryTarget.Component });
1468
+ ConnectorModalComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.3.9", type: ConnectorModalComponent, selector: "valtimo-connector-modal", viewQueries: [{ propertyName: "connectorCreateModal", first: true, predicate: ["connectorCreateModal"], descendants: true }, { propertyName: "connectorEditModal", first: true, predicate: ["connectorEditModal"], descendants: true }], ngImport: i0, 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<v-modal #connectorEditModal>\n <div role=\"header\">\n <div class=\"edit-connector-title\">\n <v-title [margin]=\"false\">{{ 'connectorManagement.modify' | translate }}</v-title>\n </div>\n </div>\n <div role=\"content\">\n <valtimo-modify-connector\n [showSaveButton]=\"false\"\n [showDeleteButton]=\"false\"\n ></valtimo-modify-connector>\n </div>\n <div role=\"footer\">\n <div class=\"edit-connector-buttons\">\n <v-button\n [disabled]=\"inputDisabled$ | async\"\n (clickEvent)=\"delete()\"\n [mdiIcon]=\"'delete'\"\n type=\"danger\"\n >{{ 'connectorManagement.remove' | translate }}</v-button\n >\n <v-button\n *ngIf=\"(hideModalSaveButton$ | async) === false\"\n [disabled]=\"(saveButtonDisabled$ | async) || (inputDisabled$ | async)\"\n (clickEvent)=\"complete()\"\n [mdiIcon]=\"'check'\"\n type=\"success\"\n >{{ 'connectorManagement.save' | translate }}</v-button\n >\n </div>\n </div>\n</v-modal>\n\n<v-stepper-container\n (completeEvent)=\"complete()\"\n (cancelClickEvent)=\"hide()\"\n [disabled]=\"inputDisabled$ | async\"\n [returnToFirstStepSubject$]=\"returnToFirstStepSubject$\"\n>\n <v-modal #connectorCreateModal (closeEvent)=\"hide()\">\n <div role=\"header\">\n <v-stepper-header></v-stepper-header>\n </div>\n <div role=\"content\">\n <v-stepper-content>\n <v-stepper-step titleTranslationKey=\"addConnectorSteps.step0\">\n <valtimo-add-connector-select></valtimo-add-connector-select>\n </v-stepper-step>\n <v-stepper-step titleTranslationKey=\"addConnectorSteps.step1\">\n <valtimo-add-connector-configure\n [showSaveButton]=\"false\"\n ></valtimo-add-connector-configure>\n </v-stepper-step>\n </v-stepper-content>\n </div>\n <div role=\"footer\">\n <v-stepper-footer>\n <v-stepper-footer-step\n nextButtonTranslationKey=\"addConnectorSteps.step1\"\n [nextButtonEnabled]=\"connectorTypeSelected$ | async\"\n ></v-stepper-footer-step>\n <v-stepper-footer-step\n completeButtonTranslationKey=\"addConnectorSteps.complete\"\n [completeButtonEnabled]=\"(saveButtonDisabled$ | async) === false\"\n [showCompleteButton]=\"(hideModalSaveButton$ | async) === false\"\n ></v-stepper-footer-step>\n </v-stepper-footer>\n </div>\n </v-modal>\n</v-stepper-container>\n", 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 */.edit-connector-buttons,.edit-connector-title{width:100%;display:flex;flex-direction:row;justify-content:space-between}.edit-connector-title{justify-content:center}\n"], components: [{ type: i2$2.ModalComponent, selector: "v-modal", inputs: ["appearingDelayMs", "maxWidthPx"], outputs: ["closeEvent"] }, { type: i2$2.TitleComponent, selector: "v-title", inputs: ["type", "margin"] }, { type: ModifyConnectorComponent, selector: "valtimo-modify-connector", inputs: ["showSaveButton", "showDeleteButton"] }, { type: i2$2.ButtonComponent, selector: "v-button", inputs: ["type", "mdiIcon", "disabled"], outputs: ["clickEvent"] }, { type: i2$2.StepperContainerComponent, selector: "v-stepper-container", inputs: ["returnToFirstStepSubject$", "disabled"], outputs: ["cancelClickEvent", "completeEvent", "nextStepEvent"] }, { type: i2$2.StepperHeaderComponent, selector: "v-stepper-header" }, { type: i2$2.StepperContentComponent, selector: "v-stepper-content" }, { type: i2$2.StepperStepComponent, selector: "v-stepper-step", inputs: ["titleTranslationKey"] }, { type: AddConnectorSelectComponent, selector: "valtimo-add-connector-select" }, { type: AddConnectorConfigureComponent, selector: "valtimo-add-connector-configure", inputs: ["showSaveButton"] }, { type: i2$2.StepperFooterComponent, selector: "v-stepper-footer" }, { type: i2$2.StepperFooterStepComponent, selector: "v-stepper-footer-step", inputs: ["nextButtonEnabled", "completeButtonEnabled", "nextButtonTranslationKey", "cancelButtonTranslationKey", "completeButtonTranslationKey", "completeButtonMdiIcon", "showCompleteButton"] }], directives: [{ type: i6.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }], pipes: { "translate": i2$1.TranslatePipe, "async": i6.AsyncPipe } });
1469
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.9", ngImport: i0, type: ConnectorModalComponent, decorators: [{
1470
+ type: Component,
1471
+ args: [{ selector: 'valtimo-connector-modal', 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<v-modal #connectorEditModal>\n <div role=\"header\">\n <div class=\"edit-connector-title\">\n <v-title [margin]=\"false\">{{ 'connectorManagement.modify' | translate }}</v-title>\n </div>\n </div>\n <div role=\"content\">\n <valtimo-modify-connector\n [showSaveButton]=\"false\"\n [showDeleteButton]=\"false\"\n ></valtimo-modify-connector>\n </div>\n <div role=\"footer\">\n <div class=\"edit-connector-buttons\">\n <v-button\n [disabled]=\"inputDisabled$ | async\"\n (clickEvent)=\"delete()\"\n [mdiIcon]=\"'delete'\"\n type=\"danger\"\n >{{ 'connectorManagement.remove' | translate }}</v-button\n >\n <v-button\n *ngIf=\"(hideModalSaveButton$ | async) === false\"\n [disabled]=\"(saveButtonDisabled$ | async) || (inputDisabled$ | async)\"\n (clickEvent)=\"complete()\"\n [mdiIcon]=\"'check'\"\n type=\"success\"\n >{{ 'connectorManagement.save' | translate }}</v-button\n >\n </div>\n </div>\n</v-modal>\n\n<v-stepper-container\n (completeEvent)=\"complete()\"\n (cancelClickEvent)=\"hide()\"\n [disabled]=\"inputDisabled$ | async\"\n [returnToFirstStepSubject$]=\"returnToFirstStepSubject$\"\n>\n <v-modal #connectorCreateModal (closeEvent)=\"hide()\">\n <div role=\"header\">\n <v-stepper-header></v-stepper-header>\n </div>\n <div role=\"content\">\n <v-stepper-content>\n <v-stepper-step titleTranslationKey=\"addConnectorSteps.step0\">\n <valtimo-add-connector-select></valtimo-add-connector-select>\n </v-stepper-step>\n <v-stepper-step titleTranslationKey=\"addConnectorSteps.step1\">\n <valtimo-add-connector-configure\n [showSaveButton]=\"false\"\n ></valtimo-add-connector-configure>\n </v-stepper-step>\n </v-stepper-content>\n </div>\n <div role=\"footer\">\n <v-stepper-footer>\n <v-stepper-footer-step\n nextButtonTranslationKey=\"addConnectorSteps.step1\"\n [nextButtonEnabled]=\"connectorTypeSelected$ | async\"\n ></v-stepper-footer-step>\n <v-stepper-footer-step\n completeButtonTranslationKey=\"addConnectorSteps.complete\"\n [completeButtonEnabled]=\"(saveButtonDisabled$ | async) === false\"\n [showCompleteButton]=\"(hideModalSaveButton$ | async) === false\"\n ></v-stepper-footer-step>\n </v-stepper-footer>\n </div>\n </v-modal>\n</v-stepper-container>\n", 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 */.edit-connector-buttons,.edit-connector-title{width:100%;display:flex;flex-direction:row;justify-content:space-between}.edit-connector-title{justify-content:center}\n"] }]
1472
+ }], ctorParameters: function () { return [{ type: ConnectorManagementStateService }, { type: i2$2.ModalService }]; }, propDecorators: { connectorCreateModal: [{
1473
+ type: ViewChild,
1474
+ args: ['connectorCreateModal']
1475
+ }], connectorEditModal: [{
1476
+ type: ViewChild,
1477
+ args: ['connectorEditModal']
1478
+ }] } });
1479
+
1480
+ /*
1481
+ * Copyright 2015-2020 Ritense BV, the Netherlands.
1482
+ *
1483
+ * Licensed under EUPL, Version 1.2 (the "License");
1484
+ * you may not use this file except in compliance with the License.
1485
+ * You may obtain a copy of the License at
1486
+ *
1487
+ * https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12
1488
+ *
1489
+ * Unless required by applicable law or agreed to in writing, software
1490
+ * distributed under the License is distributed on an "AS IS" basis,
1491
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1492
+ * See the License for the specific language governing permissions and
1493
+ * limitations under the License.
1494
+ */
1495
+ class ConnectorManagementComponent {
1496
+ constructor(connectorManagementService, translateService, stateService) {
1497
+ this.connectorManagementService = connectorManagementService;
1498
+ this.translateService = translateService;
1499
+ this.stateService = stateService;
1500
+ this.loading$ = new BehaviorSubject(true);
1501
+ this.fields$ = new BehaviorSubject([]);
1502
+ this.columns$ = this.fields$.pipe(map(fields => fields.map(field => ({
1503
+ dataKey: field.key,
1504
+ labelTranslationKey: field.label,
1505
+ }))));
1506
+ this.currentPageAndSize$ = new BehaviorSubject({
1507
+ page: 0,
1508
+ size: 10,
1509
+ });
1510
+ this.pageSizes$ = new BehaviorSubject({
1511
+ collectionSize: 0,
1512
+ maxPaginationItemSize: 5,
1513
+ });
1514
+ this.pagination$ = combineLatest([
1515
+ this.currentPageAndSize$,
1516
+ this.pageSizes$,
1517
+ ]).pipe(map(([currentPage, sizes]) => ({ ...currentPage, ...sizes, page: currentPage.page + 1 })));
1518
+ this.connectorInstances$ = combineLatest([
1519
+ this.currentPageAndSize$,
1520
+ this.translateService.stream('key'),
1521
+ this.stateService.refresh$,
1522
+ ]).pipe(tap(() => this.setFields()), switchMap(([currentPage]) => combineLatest([
1523
+ this.connectorManagementService.getConnectorInstances({
1524
+ page: currentPage.page,
1525
+ size: currentPage.size,
1526
+ }),
1527
+ this.connectorManagementService.getConnectorTypes(),
1528
+ ])), tap(([instanceRes]) => {
1529
+ this.pageSizes$.pipe(take(1)).subscribe(sizes => {
1530
+ this.pageSizes$.next({ ...sizes, collectionSize: instanceRes.totalElements });
1531
+ });
1532
+ }), map(([instanceRes, typesRes]) => instanceRes.content.map(instance => ({
1533
+ ...instance,
1534
+ typeName: typesRes.find(type => type.id === instance.type.id)?.name,
1535
+ }))), tap(() => this.loading$.next(false)));
1536
+ }
1537
+ ngOnDestroy() {
1538
+ this.stateService.hideModal();
1539
+ }
1540
+ paginationClicked(newPageNumber) {
1541
+ this.currentPageAndSize$.pipe(take(1)).subscribe(currentPage => {
1542
+ this.currentPageAndSize$.next({ ...currentPage, page: newPageNumber - 1 });
1543
+ });
1544
+ }
1545
+ paginationSet(newPageSize) {
1546
+ if (newPageSize) {
1547
+ this.currentPageAndSize$.pipe(take(1)).subscribe(currentPage => {
1548
+ this.currentPageAndSize$.next({ ...currentPage, size: newPageSize });
1549
+ });
1550
+ }
1551
+ }
1552
+ rowClicked(instance) {
1553
+ this.stateService.setModalType('modify');
1554
+ this.stateService.setConnectorInstance(instance);
1555
+ this.stateService.showModal();
1556
+ }
1557
+ showAddModal() {
1558
+ this.stateService.setModalType('add');
1559
+ this.stateService.showModal();
1560
+ }
1561
+ setFields() {
1562
+ const keys = ['name', 'typeName'];
1563
+ this.fields$.next(keys.map(key => ({ label: `connectorManagement.labels.${key}`, key })));
1564
+ }
1565
+ }
1566
+ ConnectorManagementComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.9", ngImport: i0, type: ConnectorManagementComponent, deps: [{ token: ConnectorManagementService }, { token: i2$1.TranslateService }, { token: ConnectorManagementStateService }], target: i0.ɵɵFactoryTarget.Component });
1567
+ ConnectorManagementComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.3.9", type: ConnectorManagementComponent, selector: "valtimo-connector-management", ngImport: i0, 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<v-page-container\n *ngIf=\"{\n connectorInstances: connectorInstances$ | async,\n fields: fields$ | async,\n columns: columns$ | async,\n pagination: pagination$ | async,\n loading: loading$ | async\n } as obs\"\n>\n <v-page-header>\n <v-page-header-introduction>\n <v-title>{{ 'pages.connectors.title' | translate }}</v-title>\n <v-paragraph>{{ 'pages.connectors.description' | translate }}</v-paragraph>\n </v-page-header-introduction>\n <v-page-header-actions>\n <v-button\n (clickEvent)=\"showAddModal()\"\n type=\"primary\"\n mdiIcon=\"plus\"\n [disabled]=\"obs.loading\"\n >\n {{ 'connectorManagement.add' | translate }}\n </v-button>\n </v-page-header-actions>\n </v-page-header>\n <v-page-content>\n <v-table\n [loading]=\"obs.loading\"\n [items]=\"obs.connectorInstances\"\n [columns]=\"obs.columns\"\n [showEditButtons]=\"true\"\n [amountOfLoadingRows]=\"2\"\n [collectionSize]=\"obs.pagination.collectionSize\"\n [maxPaginationItemSize]=\"obs.pagination.maxPaginationItemSize\"\n [page]=\"obs.pagination.page\"\n [size]=\"obs.pagination.size\"\n [itemsTranslationKey]=\"'connectorManagement.tableItemsText'\"\n (editButtonClicked)=\"rowClicked($event)\"\n (paginationSizeSet)=\"paginationSet($event)\"\n (paginationPageSet)=\"paginationClicked($event)\"\n ></v-table>\n </v-page-content>\n</v-page-container>\n\n<valtimo-connector-modal></valtimo-connector-modal>\n", 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 */\n"], components: [{ type: i2$2.PageContainerComponent, selector: "v-page-container" }, { type: i2$2.PageHeaderComponent, selector: "v-page-header" }, { type: i2$2.PageHeaderIntroductionComponent, selector: "v-page-header-introduction" }, { type: i2$2.TitleComponent, selector: "v-title", inputs: ["type", "margin"] }, { type: i2$2.ParagraphComponent, selector: "v-paragraph" }, { type: i2$2.PageHeaderActionsComponent, selector: "v-page-header-actions" }, { type: i2$2.ButtonComponent, selector: "v-button", inputs: ["type", "mdiIcon", "disabled"], outputs: ["clickEvent"] }, { type: i2$2.PageContentComponent, selector: "v-page-content" }, { type: i2$2.TableComponent, selector: "v-table", inputs: ["items", "columns", "loading", "showEditButtons", "showPagination", "editButtonTranslationKey", "itemsTranslationKey", "mobileBreakpointPx", "amountOfLoadingRows", "collectionSize", "maxPaginationItemSize", "page", "size"], outputs: ["editButtonClicked", "paginationSizeSet", "paginationPageSet"] }, { type: ConnectorModalComponent, selector: "valtimo-connector-modal" }], directives: [{ type: i6.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }], pipes: { "async": i6.AsyncPipe, "translate": i2$1.TranslatePipe } });
1568
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.9", ngImport: i0, type: ConnectorManagementComponent, decorators: [{
1569
+ type: Component,
1570
+ args: [{ selector: 'valtimo-connector-management', 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<v-page-container\n *ngIf=\"{\n connectorInstances: connectorInstances$ | async,\n fields: fields$ | async,\n columns: columns$ | async,\n pagination: pagination$ | async,\n loading: loading$ | async\n } as obs\"\n>\n <v-page-header>\n <v-page-header-introduction>\n <v-title>{{ 'pages.connectors.title' | translate }}</v-title>\n <v-paragraph>{{ 'pages.connectors.description' | translate }}</v-paragraph>\n </v-page-header-introduction>\n <v-page-header-actions>\n <v-button\n (clickEvent)=\"showAddModal()\"\n type=\"primary\"\n mdiIcon=\"plus\"\n [disabled]=\"obs.loading\"\n >\n {{ 'connectorManagement.add' | translate }}\n </v-button>\n </v-page-header-actions>\n </v-page-header>\n <v-page-content>\n <v-table\n [loading]=\"obs.loading\"\n [items]=\"obs.connectorInstances\"\n [columns]=\"obs.columns\"\n [showEditButtons]=\"true\"\n [amountOfLoadingRows]=\"2\"\n [collectionSize]=\"obs.pagination.collectionSize\"\n [maxPaginationItemSize]=\"obs.pagination.maxPaginationItemSize\"\n [page]=\"obs.pagination.page\"\n [size]=\"obs.pagination.size\"\n [itemsTranslationKey]=\"'connectorManagement.tableItemsText'\"\n (editButtonClicked)=\"rowClicked($event)\"\n (paginationSizeSet)=\"paginationSet($event)\"\n (paginationPageSet)=\"paginationClicked($event)\"\n ></v-table>\n </v-page-content>\n</v-page-container>\n\n<valtimo-connector-modal></valtimo-connector-modal>\n", 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 */\n"] }]
1571
+ }], ctorParameters: function () { return [{ type: ConnectorManagementService }, { type: i2$1.TranslateService }, { type: ConnectorManagementStateService }]; } });
1572
+
1573
+ /*
1574
+ * Copyright 2015-2020 Ritense BV, the Netherlands.
1575
+ *
1576
+ * Licensed under EUPL, Version 1.2 (the "License");
1577
+ * you may not use this file except in compliance with the License.
1578
+ * You may obtain a copy of the License at
1579
+ *
1580
+ * https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12
1581
+ *
1582
+ * Unless required by applicable law or agreed to in writing, software
1583
+ * distributed under the License is distributed on an "AS IS" basis,
1584
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1585
+ * See the License for the specific language governing permissions and
1586
+ * limitations under the License.
1587
+ */
1588
+ const routes = [
1589
+ {
1590
+ path: 'connectors',
1591
+ component: ConnectorManagementComponent,
1592
+ canActivate: [AuthGuardService],
1593
+ data: { title: 'Connectors', roles: [ROLE_ADMIN] },
1594
+ },
1595
+ ];
1596
+ class ConnectorManagementRoutingModule {
1597
+ }
1598
+ ConnectorManagementRoutingModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.9", ngImport: i0, type: ConnectorManagementRoutingModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
1599
+ ConnectorManagementRoutingModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "12.0.0", version: "13.3.9", ngImport: i0, type: ConnectorManagementRoutingModule, imports: [CommonModule, i5.RouterModule], exports: [RouterModule] });
1600
+ ConnectorManagementRoutingModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "13.3.9", ngImport: i0, type: ConnectorManagementRoutingModule, imports: [[CommonModule, RouterModule.forChild(routes)], RouterModule] });
1601
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.9", ngImport: i0, type: ConnectorManagementRoutingModule, decorators: [{
1602
+ type: NgModule,
1603
+ args: [{
1604
+ declarations: [],
1605
+ imports: [CommonModule, RouterModule.forChild(routes)],
1606
+ exports: [RouterModule],
1607
+ }]
1608
+ }] });
1609
+
1610
+ /*
1611
+ * Copyright 2015-2020 Ritense BV, the Netherlands.
1612
+ *
1613
+ * Licensed under EUPL, Version 1.2 (the "License");
1614
+ * you may not use this file except in compliance with the License.
1615
+ * You may obtain a copy of the License at
1616
+ *
1617
+ * https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12
1618
+ *
1619
+ * Unless required by applicable law or agreed to in writing, software
1620
+ * distributed under the License is distributed on an "AS IS" basis,
1621
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1622
+ * See the License for the specific language governing permissions and
1623
+ * limitations under the License.
1624
+ */
1625
+ class ObjectApiSyncService {
1626
+ constructor(http, configService) {
1627
+ this.http = http;
1628
+ this.configService = configService;
1629
+ this.valtimoApiConfig = configService.config.valtimoApi;
1630
+ }
1631
+ getObjectSyncConfigs(documentDefinitionName) {
1632
+ return this.http.get(`${this.valtimoApiConfig.endpointUri}object/sync/config`, { params: { documentDefinitionName } });
1633
+ }
1634
+ createObjectSyncConfig(request) {
1635
+ return this.http.post(`${this.valtimoApiConfig.endpointUri}object/sync/config`, request);
1636
+ }
1637
+ modifyObjectSyncConfig(request) {
1638
+ return this.http.put(`${this.valtimoApiConfig.endpointUri}object/sync/config`, request);
1639
+ }
1640
+ deleteObjectSyncConfig(configId) {
1641
+ return this.http.delete(`${this.valtimoApiConfig.endpointUri}object/sync/config/${configId}`);
1642
+ }
1643
+ }
1644
+ ObjectApiSyncService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.9", ngImport: i0, type: ObjectApiSyncService, deps: [{ token: i1.HttpClient }, { token: i2.ConfigService }], target: i0.ɵɵFactoryTarget.Injectable });
1645
+ ObjectApiSyncService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "13.3.9", ngImport: i0, type: ObjectApiSyncService, providedIn: 'root' });
1646
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.9", ngImport: i0, type: ObjectApiSyncService, decorators: [{
1647
+ type: Injectable,
1648
+ args: [{
1649
+ providedIn: 'root',
1650
+ }]
1651
+ }], ctorParameters: function () { return [{ type: i1.HttpClient }, { type: i2.ConfigService }]; } });
1652
+
1653
+ /*
1654
+ * Copyright 2015-2020 Ritense BV, the Netherlands.
1655
+ *
1656
+ * Licensed under EUPL, Version 1.2 (the "License");
1657
+ * you may not use this file except in compliance with the License.
1658
+ * You may obtain a copy of the License at
1659
+ *
1660
+ * https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12
1661
+ *
1662
+ * Unless required by applicable law or agreed to in writing, software
1663
+ * distributed under the License is distributed on an "AS IS" basis,
1664
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1665
+ * See the License for the specific language governing permissions and
1666
+ * limitations under the License.
1667
+ */
1668
+ class ConnectorLinkExtensionModalComponent {
1669
+ constructor(connectorManagementService, translateService, stateService, objectApiSyncService, route, alertService) {
1670
+ this.connectorManagementService = connectorManagementService;
1671
+ this.translateService = translateService;
1672
+ this.stateService = stateService;
1673
+ this.objectApiSyncService = objectApiSyncService;
1674
+ this.route = route;
1675
+ this.alertService = alertService;
1676
+ this.loading$ = new BehaviorSubject(true);
1677
+ this.fields$ = new BehaviorSubject([]);
1678
+ this.currentPageAndSize$ = new BehaviorSubject({
1679
+ page: 0,
1680
+ size: 10,
1681
+ });
1682
+ this.pageSizes$ = new BehaviorSubject({
1683
+ collectionSize: 0,
1684
+ maxPaginationItemSize: 5,
1685
+ });
1686
+ this.pagination$ = combineLatest([
1687
+ this.currentPageAndSize$,
1688
+ this.pageSizes$,
1689
+ ]).pipe(map(([currentPage, sizes]) => ({ ...currentPage, ...sizes, page: currentPage.page + 1 })));
1690
+ this.connectorInstances$ = combineLatest([
1691
+ this.currentPageAndSize$,
1692
+ this.connectorManagementService.getConnectorTypes(),
1693
+ this.translateService.stream('key'),
1694
+ this.stateService.refresh$,
1695
+ ]).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 => {
1696
+ this.pageSizes$.pipe(take(1)).subscribe(sizes => {
1697
+ this.pageSizes$.next({ ...sizes, collectionSize: instanceRes.totalElements });
1698
+ });
1699
+ }), map(res => res.content), tap(() => this.loading$.next(false)));
1700
+ this.noObjectsApiConnectors$ = this.connectorInstances$.pipe(map(instances => !instances || instances.length === 0));
1701
+ this.disabled$ = this.stateService.inputDisabled$;
1702
+ }
1703
+ ngAfterViewInit() {
1704
+ this.showSubscription = this.stateService.showExtensionModal$.subscribe(show => {
1705
+ if (show) {
1706
+ this.show();
1707
+ }
1708
+ else {
1709
+ this.hide();
1710
+ }
1711
+ });
1712
+ }
1713
+ ngOnDestroy() {
1714
+ this.showSubscription?.unsubscribe();
1715
+ }
1716
+ paginationClicked(newPageNumber) {
1717
+ this.currentPageAndSize$.pipe(take(1)).subscribe(currentPage => {
1718
+ this.currentPageAndSize$.next({ ...currentPage, page: newPageNumber - 1 });
1719
+ });
1720
+ }
1721
+ paginationSet(newPageSize) {
1722
+ if (newPageSize) {
1723
+ this.currentPageAndSize$.pipe(take(1)).subscribe(currentPage => {
1724
+ this.currentPageAndSize$.next({ ...currentPage, size: newPageSize });
1725
+ });
1726
+ }
1727
+ }
1728
+ rowClicked(instance) {
1729
+ const connectorInstanceId = instance.id;
1730
+ const enabled = true;
1731
+ const documentDefinitionName = this.route.snapshot.paramMap.get('name');
1732
+ const objectTypeUrl = instance.properties?.objectType?.url;
1733
+ const splitObjectTypeUrl = objectTypeUrl?.split('/');
1734
+ const objectTypeId = splitObjectTypeUrl[splitObjectTypeUrl.length - 1];
1735
+ this.stateService.disableInput();
1736
+ this.objectApiSyncService
1737
+ .createObjectSyncConfig({ connectorInstanceId, enabled, documentDefinitionName, objectTypeId })
1738
+ .subscribe(res => {
1739
+ this.alertService.success(this.translateService.instant('connectorManagement.extension.addSyncSuccess'));
1740
+ this.stateService.hideExtensionModal();
1741
+ this.stateService.enableInput();
1742
+ this.stateService.refresh();
1743
+ this.stateService.setLastConfigIdAdded(res.objectSyncConfig.id);
1744
+ }, () => {
1745
+ this.stateService.enableInput();
1746
+ });
1747
+ }
1748
+ setFields() {
1749
+ const getTranslatedLabel = (key) => this.translateService.instant(`connectorManagement.labels.${key}`);
1750
+ const keys = ['name'];
1751
+ this.fields$.next(keys.map(key => ({ label: getTranslatedLabel(key), key })));
1752
+ }
1753
+ show() {
1754
+ this.modal.show();
1755
+ }
1756
+ hide() {
1757
+ this.modal.hide();
1758
+ }
1759
+ }
1760
+ ConnectorLinkExtensionModalComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.9", ngImport: i0, type: ConnectorLinkExtensionModalComponent, deps: [{ token: ConnectorManagementService }, { token: i2$1.TranslateService }, { token: ConnectorManagementStateService }, { token: ObjectApiSyncService }, { token: i5.ActivatedRoute }, { token: i6$1.AlertService }], target: i0.ɵɵFactoryTarget.Component });
1761
+ ConnectorLinkExtensionModalComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.3.9", type: ConnectorLinkExtensionModalComponent, selector: "valtimo-connector-link-extension-modal", viewQueries: [{ propertyName: "modal", first: true, predicate: ["modal"], descendants: true }], ngImport: i0, template: "<valtimo-modal #modal [title]=\"'connectorManagement.extension.buttonText' | translate\">\n <div\n class=\"mt-2\"\n body\n *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 >\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\">\n {{ 'connectorManagement.subtitle' | translate }}\n </h5>\n </div>\n </valtimo-list>\n </valtimo-widget>\n </ng-container>\n </div>\n </div>\n</valtimo-modal>\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", styles: [".disabled{opacity:.8;pointer-events:none;filter:grayscale(1)}\n"], components: [{ type: i6$1.ModalComponent, selector: "valtimo-modal", inputs: ["elementId", "title", "subtitle", "templateBelowSubtitle", "showFooter"] }, { type: i6$1.WidgetComponent, selector: "valtimo-widget", inputs: ["type", "name", "icon", "contrast", "divider", "title", "subtitle", "collapseAble", "collapse", "additionalClasses"] }, { type: i6$1.ListComponent, selector: "valtimo-list", inputs: ["items", "fields", "pagination", "viewMode", "isSearchable", "header", "actions", "paginationIdentifier", "initialSortState"], outputs: ["rowClicked", "paginationClicked", "paginationSet", "search", "sortChanged"] }, { type: i6$1.SpinnerComponent, selector: "valtimo-spinner", inputs: ["useBootstrapSpinner", "name", "type", "size", "color", "bdColor", "fullScreen", "noMarginTop"] }], directives: [{ type: i6.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { type: i6.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { type: i8.DefaultClassDirective, selector: " [ngClass], [ngClass.xs], [ngClass.sm], [ngClass.md], [ngClass.lg], [ngClass.xl], [ngClass.lt-sm], [ngClass.lt-md], [ngClass.lt-lg], [ngClass.lt-xl], [ngClass.gt-xs], [ngClass.gt-sm], [ngClass.gt-md], [ngClass.gt-lg]", inputs: ["ngClass", "ngClass.xs", "ngClass.sm", "ngClass.md", "ngClass.lg", "ngClass.xl", "ngClass.lt-sm", "ngClass.lt-md", "ngClass.lt-lg", "ngClass.lt-xl", "ngClass.gt-xs", "ngClass.gt-sm", "ngClass.gt-md", "ngClass.gt-lg"] }], pipes: { "translate": i2$1.TranslatePipe, "async": i6.AsyncPipe } });
1762
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.9", ngImport: i0, type: ConnectorLinkExtensionModalComponent, decorators: [{
1763
+ type: Component,
1764
+ args: [{ selector: 'valtimo-connector-link-extension-modal', template: "<valtimo-modal #modal [title]=\"'connectorManagement.extension.buttonText' | translate\">\n <div\n class=\"mt-2\"\n body\n *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 >\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\">\n {{ 'connectorManagement.subtitle' | translate }}\n </h5>\n </div>\n </valtimo-list>\n </valtimo-widget>\n </ng-container>\n </div>\n </div>\n</valtimo-modal>\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", styles: [".disabled{opacity:.8;pointer-events:none;filter:grayscale(1)}\n"] }]
1765
+ }], ctorParameters: function () { return [{ type: ConnectorManagementService }, { type: i2$1.TranslateService }, { type: ConnectorManagementStateService }, { type: ObjectApiSyncService }, { type: i5.ActivatedRoute }, { type: i6$1.AlertService }]; }, propDecorators: { modal: [{
1766
+ type: ViewChild,
1767
+ args: ['modal']
1768
+ }] } });
1769
+
1770
+ /*
1771
+ * Copyright 2015-2020 Ritense BV, the Netherlands.
1772
+ *
1773
+ * Licensed under EUPL, Version 1.2 (the "License");
1774
+ * you may not use this file except in compliance with the License.
1775
+ * You may obtain a copy of the License at
1776
+ *
1777
+ * https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12
1778
+ *
1779
+ * Unless required by applicable law or agreed to in writing, software
1780
+ * distributed under the License is distributed on an "AS IS" basis,
1781
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1782
+ * See the License for the specific language governing permissions and
1783
+ * limitations under the License.
1784
+ */
1785
+ class ConnectorLinkExtensionComponent {
1786
+ constructor(stateService, objectApiSyncService, translateService, route, alertService, connectorManagementService) {
1787
+ this.stateService = stateService;
1788
+ this.objectApiSyncService = objectApiSyncService;
1789
+ this.translateService = translateService;
1790
+ this.route = route;
1791
+ this.alertService = alertService;
1792
+ this.connectorManagementService = connectorManagementService;
1793
+ this.loading$ = new BehaviorSubject(true);
1794
+ this.objectApiSyncConfig$ = combineLatest([
1795
+ this.route.params,
1796
+ this.translateService.stream('key'),
1797
+ this.stateService.refresh$,
1798
+ ]).pipe(switchMap(([params]) => this.objectApiSyncService.getObjectSyncConfigs(params.name)), switchMap(configs => combineLatest([
1799
+ of(configs),
1800
+ ...configs.map(config => this.connectorManagementService
1801
+ .getConnectorInstanceById(config.connectorInstanceId)
1802
+ .pipe(catchError(() => of('')))),
1803
+ ])), map(results => {
1804
+ const [, ...instances] = results.filter(result => result);
1805
+ return results[0].map(syncConfig => ({
1806
+ ...syncConfig,
1807
+ title: instances.find(instance => instance.id === syncConfig.connectorInstanceId)?.name ||
1808
+ 'Objects API',
1809
+ }));
1810
+ }), map(results => (Array.isArray(results) && results.length > 0 ? results[0] : null)), tap(() => {
1811
+ this.loading$.next(false);
1812
+ }));
1813
+ this.disabled$ = this.stateService.inputDisabled$;
1814
+ }
1815
+ ngOnDestroy() {
1816
+ this.stateService.hideExtensionModal();
1817
+ }
1818
+ openModal() {
1819
+ this.stateService.showExtensionModal();
1820
+ }
1821
+ toggleSync(config) {
1822
+ this.stateService.disableInput();
1823
+ this.objectApiSyncService
1824
+ .modifyObjectSyncConfig({ ...config, enabled: !config.enabled })
1825
+ .subscribe(() => {
1826
+ if (!config.enabled) {
1827
+ this.alertService.success(this.translateService.instant('connectorManagement.extension.addSyncSuccess'));
1828
+ }
1829
+ else {
1830
+ this.alertService.success(this.translateService.instant('connectorManagement.extension.disableSyncSuccess'));
1831
+ }
1832
+ this.stateService.enableInput();
1833
+ this.stateService.refresh();
1834
+ }, () => {
1835
+ this.stateService.enableInput();
1836
+ });
1837
+ }
1838
+ deleteSync(configId) {
1839
+ this.stateService.disableInput();
1840
+ this.objectApiSyncService.deleteObjectSyncConfig(configId).subscribe(() => {
1841
+ this.alertService.success(this.translateService.instant('connectorManagement.extension.deleteSyncSuccess'));
1842
+ this.stateService.enableInput();
1843
+ this.stateService.refresh();
1844
+ }, () => {
1845
+ this.stateService.enableInput();
1846
+ });
1847
+ }
1848
+ }
1849
+ ConnectorLinkExtensionComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.9", ngImport: i0, type: ConnectorLinkExtensionComponent, deps: [{ token: ConnectorManagementStateService }, { token: ObjectApiSyncService }, { token: i2$1.TranslateService }, { token: i5.ActivatedRoute }, { token: i6$1.AlertService }, { token: ConnectorManagementService }], target: i0.ɵɵFactoryTarget.Component });
1850
+ ConnectorLinkExtensionComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.3.9", type: ConnectorLinkExtensionComponent, selector: "valtimo-connector-link-extension", ngImport: i0, template: "<h2 class=\"mb-4 mt-6\">{{ 'connectorManagement.extension.title' | translate }}</h2>\n\n<ng-container\n *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 card-contrast\">\n <div class=\"card-header card-header-contrast card-header-featured\">\n <div>\n {{ obs.syncConfig.title }}\n </div>\n <div class=\"controls\">\n <button\n class=\"btn btn-danger ml-3\"\n [disabled]=\"obs.disabled\"\n (click)=\"deleteSync(obs.syncConfig.id)\"\n >\n <i class=\"icon mdi mdi-delete\"></i>\n </button>\n </div>\n </div>\n <div class=\"card-body\">\n <div class=\"setting-row\">\n {{ 'connectorManagement.autoSync' | translate }}\n <div class=\"controls\">\n <div class=\"switch-button switch-button-success\">\n <input\n type=\"checkbox\"\n [checked]=\"obs.syncConfig.enabled\"\n [disabled]=\"obs.disabled\"\n name=\"sync\"\n id=\"sync\"\n (click)=\"toggleSync(obs.syncConfig)\"\n />\n <span><label for=\"sync\"></label></span>\n </div>\n </div>\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 mr-1\"></i>\n {{ 'connectorManagement.extension.buttonText' | translate }}\n </button>\n </div>\n</ng-template>\n", styles: [".card-header,.setting-row{display:flex;flex-direction:row;justify-content:space-between;align-items:center}.controls{display:flex;align-items:center}\n"], components: [{ type: ConnectorLinkExtensionModalComponent, selector: "valtimo-connector-link-extension-modal" }, { type: i6$1.SpinnerComponent, selector: "valtimo-spinner", inputs: ["useBootstrapSpinner", "name", "type", "size", "color", "bdColor", "fullScreen", "noMarginTop"] }], directives: [{ type: i6.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }], pipes: { "translate": i2$1.TranslatePipe, "async": i6.AsyncPipe } });
1851
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.9", ngImport: i0, type: ConnectorLinkExtensionComponent, decorators: [{
1852
+ type: Component,
1853
+ args: [{ selector: 'valtimo-connector-link-extension', template: "<h2 class=\"mb-4 mt-6\">{{ 'connectorManagement.extension.title' | translate }}</h2>\n\n<ng-container\n *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 card-contrast\">\n <div class=\"card-header card-header-contrast card-header-featured\">\n <div>\n {{ obs.syncConfig.title }}\n </div>\n <div class=\"controls\">\n <button\n class=\"btn btn-danger ml-3\"\n [disabled]=\"obs.disabled\"\n (click)=\"deleteSync(obs.syncConfig.id)\"\n >\n <i class=\"icon mdi mdi-delete\"></i>\n </button>\n </div>\n </div>\n <div class=\"card-body\">\n <div class=\"setting-row\">\n {{ 'connectorManagement.autoSync' | translate }}\n <div class=\"controls\">\n <div class=\"switch-button switch-button-success\">\n <input\n type=\"checkbox\"\n [checked]=\"obs.syncConfig.enabled\"\n [disabled]=\"obs.disabled\"\n name=\"sync\"\n id=\"sync\"\n (click)=\"toggleSync(obs.syncConfig)\"\n />\n <span><label for=\"sync\"></label></span>\n </div>\n </div>\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 mr-1\"></i>\n {{ 'connectorManagement.extension.buttonText' | translate }}\n </button>\n </div>\n</ng-template>\n", styles: [".card-header,.setting-row{display:flex;flex-direction:row;justify-content:space-between;align-items:center}.controls{display:flex;align-items:center}\n"] }]
1854
+ }], ctorParameters: function () { return [{ type: ConnectorManagementStateService }, { type: ObjectApiSyncService }, { type: i2$1.TranslateService }, { type: i5.ActivatedRoute }, { type: i6$1.AlertService }, { type: ConnectorManagementService }]; } });
1855
+
1856
+ /*
1857
+ * Copyright 2015-2020 Ritense BV, the Netherlands.
1858
+ *
1859
+ * Licensed under EUPL, Version 1.2 (the "License");
1860
+ * you may not use this file except in compliance with the License.
1861
+ * You may obtain a copy of the License at
1862
+ *
1863
+ * https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12
1864
+ *
1865
+ * Unless required by applicable law or agreed to in writing, software
1866
+ * distributed under the License is distributed on an "AS IS" basis,
1867
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1868
+ * See the License for the specific language governing permissions and
1869
+ * limitations under the License.
1870
+ */
1871
+ class ConnectorManagementModule {
1872
+ }
1873
+ ConnectorManagementModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.9", ngImport: i0, type: ConnectorManagementModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
1874
+ ConnectorManagementModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "12.0.0", version: "13.3.9", ngImport: i0, type: ConnectorManagementModule, declarations: [ConnectorManagementComponent,
1875
+ AddConnectorSelectComponent,
1876
+ AddConnectorConfigureComponent,
1877
+ ConnectorModalComponent,
1878
+ ModifyConnectorComponent,
1879
+ EditConnectorPropertiesComponent,
1880
+ MultiValueConnectorPropertyComponent,
1881
+ ConnectorLinkExtensionComponent,
1882
+ ConnectorLinkExtensionModalComponent,
1883
+ EditProductAanvragenConnectorComponent,
1884
+ EditConnectorFormComponent,
1885
+ EditTaakConnectorComponent], imports: [CommonModule,
1886
+ ConnectorManagementRoutingModule,
1887
+ TranslateModule,
1888
+ WidgetModule,
1889
+ ListModule,
1890
+ SpinnerModule,
1891
+ ModalModule,
1892
+ FormIoModule,
1893
+ ButtonModule,
1894
+ TableModule,
1895
+ ModalModule$1,
1896
+ StepperModule,
1897
+ CardModule,
1898
+ FlexLayoutModule,
1899
+ TitleModule,
1900
+ InputModule,
1901
+ PageModule,
1902
+ ParagraphModule], exports: [ConnectorManagementComponent,
1903
+ AddConnectorSelectComponent,
1904
+ AddConnectorConfigureComponent,
1905
+ ConnectorModalComponent,
1906
+ ModifyConnectorComponent,
1907
+ EditConnectorPropertiesComponent,
1908
+ MultiValueConnectorPropertyComponent,
1909
+ ConnectorLinkExtensionComponent,
1910
+ ConnectorLinkExtensionModalComponent,
1911
+ EditProductAanvragenConnectorComponent,
1912
+ EditTaakConnectorComponent] });
1913
+ ConnectorManagementModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "13.3.9", ngImport: i0, type: ConnectorManagementModule, providers: [ConnectorManagementStateService], imports: [[
1914
+ CommonModule,
1915
+ ConnectorManagementRoutingModule,
1916
+ TranslateModule,
1917
+ WidgetModule,
1918
+ ListModule,
1919
+ SpinnerModule,
1920
+ ModalModule,
1921
+ FormIoModule,
1922
+ ButtonModule,
1923
+ TableModule,
1924
+ ModalModule$1,
1925
+ StepperModule,
1926
+ CardModule,
1927
+ FlexLayoutModule,
1928
+ TitleModule,
1929
+ InputModule,
1930
+ PageModule,
1931
+ ParagraphModule,
1932
+ ]] });
1933
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.9", ngImport: i0, type: ConnectorManagementModule, decorators: [{
1934
+ type: NgModule,
1935
+ args: [{
1936
+ providers: [ConnectorManagementStateService],
1937
+ declarations: [
1938
+ ConnectorManagementComponent,
1939
+ AddConnectorSelectComponent,
1940
+ AddConnectorConfigureComponent,
1941
+ ConnectorModalComponent,
1942
+ ModifyConnectorComponent,
1943
+ EditConnectorPropertiesComponent,
1944
+ MultiValueConnectorPropertyComponent,
1945
+ ConnectorLinkExtensionComponent,
1946
+ ConnectorLinkExtensionModalComponent,
1947
+ EditProductAanvragenConnectorComponent,
1948
+ EditConnectorFormComponent,
1949
+ EditTaakConnectorComponent,
1950
+ ],
1951
+ imports: [
1952
+ CommonModule,
1953
+ ConnectorManagementRoutingModule,
1954
+ TranslateModule,
1955
+ WidgetModule,
1956
+ ListModule,
1957
+ SpinnerModule,
1958
+ ModalModule,
1959
+ FormIoModule,
1960
+ ButtonModule,
1961
+ TableModule,
1962
+ ModalModule$1,
1963
+ StepperModule,
1964
+ CardModule,
1965
+ FlexLayoutModule,
1966
+ TitleModule,
1967
+ InputModule,
1968
+ PageModule,
1969
+ ParagraphModule,
1970
+ ],
1971
+ exports: [
1972
+ ConnectorManagementComponent,
1973
+ AddConnectorSelectComponent,
1974
+ AddConnectorConfigureComponent,
1975
+ ConnectorModalComponent,
1976
+ ModifyConnectorComponent,
1977
+ EditConnectorPropertiesComponent,
1978
+ MultiValueConnectorPropertyComponent,
1979
+ ConnectorLinkExtensionComponent,
1980
+ ConnectorLinkExtensionModalComponent,
1981
+ EditProductAanvragenConnectorComponent,
1982
+ EditTaakConnectorComponent,
1983
+ ],
1984
+ }]
1985
+ }] });
1986
+
1987
+ /*
1988
+ * Copyright 2015-2020 Ritense BV, the Netherlands.
1989
+ *
1990
+ * Licensed under EUPL, Version 1.2 (the "License");
1991
+ * you may not use this file except in compliance with the License.
1992
+ * You may obtain a copy of the License at
1993
+ *
1994
+ * https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12
1995
+ *
1996
+ * Unless required by applicable law or agreed to in writing, software
1997
+ * distributed under the License is distributed on an "AS IS" basis,
1998
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1999
+ * See the License for the specific language governing permissions and
2000
+ * limitations under the License.
2001
+ */
2002
+ function connectorLinkExtensionInitializer(injector) {
2003
+ const configService = injector.get(ConfigService);
2004
+ const logger = injector.get(NGXLogger);
2005
+ return () => new Promise((resolve, reject) => {
2006
+ try {
2007
+ logger.debug('connector link extension initializer before init');
2008
+ const extension = new Extension('ConnectorLink', new BasicExtensionPoint('dossier-management', 'dossier', 'right-panel', ConnectorLinkExtensionComponent));
2009
+ configService.addExtension(extension);
2010
+ logger.debug('connector link extension initializer after init');
2011
+ resolve();
2012
+ }
2013
+ catch (error) {
2014
+ logger.debug('connector link extension initializer error', error);
2015
+ reject(error);
2016
+ }
2017
+ });
2018
+ }
2019
+
2020
+ /*
2021
+ * Copyright 2015-2020 Ritense BV, the Netherlands.
2022
+ *
2023
+ * Licensed under EUPL, Version 1.2 (the "License");
2024
+ * you may not use this file except in compliance with the License.
2025
+ * You may obtain a copy of the License at
2026
+ *
2027
+ * https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12
2028
+ *
2029
+ * Unless required by applicable law or agreed to in writing, software
2030
+ * distributed under the License is distributed on an "AS IS" basis,
2031
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
2032
+ * See the License for the specific language governing permissions and
2033
+ * limitations under the License.
2034
+ */
2035
+
2036
+ /**
2037
+ * Generated bundle index. Do not edit.
2038
+ */
2039
+
2040
+ export { AddConnectorConfigureComponent, AddConnectorSelectComponent, ConnectorLinkExtensionComponent, ConnectorLinkExtensionModalComponent, ConnectorManagementComponent, ConnectorManagementModule, ConnectorManagementService, ConnectorManagementStateService, ConnectorModalComponent, EditConnectorPropertiesComponent, EditProductAanvragenConnectorComponent, EditTaakConnectorComponent, ModifyConnectorComponent, MultiValueConnectorPropertyComponent, ObjectApiSyncService, connectorLinkExtensionInitializer };
2041
+ //# sourceMappingURL=valtimo-connector-management.mjs.map