@valtimo/connector-management 4.23.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,2044 @@
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
+ var _a;
278
+ (_a = this.valuesSubscription) === null || _a === void 0 ? void 0 : _a.unsubscribe();
279
+ }
280
+ onValueChange(value, editField, index) {
281
+ this.values$.pipe(take(1)).subscribe(values => {
282
+ this.values$.next(Object.assign(Object.assign({}, values), { [index]: editField.editType === 'string[]'
283
+ ? value.trim()
284
+ : parseInt(value, 10) }));
285
+ });
286
+ }
287
+ addRow() {
288
+ this.amountOfValues$.pipe(take(1)).subscribe(amountOfValues => {
289
+ this.amountOfValues$.next([...amountOfValues, null]);
290
+ });
291
+ }
292
+ removeRow() {
293
+ combineLatest([this.values$, this.amountOfValues$])
294
+ .pipe(take(1))
295
+ .subscribe(([values, amountOfValues]) => {
296
+ const lastValueIndex = amountOfValues.length - 1;
297
+ const valuesCopy = Object.assign({}, values);
298
+ delete valuesCopy[lastValueIndex];
299
+ this.values$.next(valuesCopy);
300
+ this.amountOfValues$.next(amountOfValues.filter((curr, index) => index !== lastValueIndex));
301
+ });
302
+ }
303
+ openValuesSubscription() {
304
+ this.valuesSubscription = this.values$.subscribe(values => {
305
+ this.valuesSet.emit({
306
+ editFieldKey: this.editField.key,
307
+ values: Object.values(values).filter(value => value === 0 || value),
308
+ });
309
+ });
310
+ }
311
+ setDefaults() {
312
+ const defaultValue = this.defaultValue;
313
+ const validValues = Array.isArray(defaultValue) && defaultValue.filter(value => value === 0 || value);
314
+ if (validValues && validValues.length > 0) {
315
+ const valuesObject = {};
316
+ validValues.forEach((value, index) => {
317
+ valuesObject[index] = value;
318
+ });
319
+ this.values$.next(valuesObject);
320
+ this.amountOfValues$.next(validValues.map(() => null));
321
+ }
322
+ }
323
+ }
324
+ MultiValueConnectorPropertyComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.9", ngImport: i0, type: MultiValueConnectorPropertyComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
325
+ 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 } });
326
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.9", ngImport: i0, type: MultiValueConnectorPropertyComponent, decorators: [{
327
+ type: Component,
328
+ 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"] }]
329
+ }], propDecorators: { editField: [{
330
+ type: Input
331
+ }], disabled: [{
332
+ type: Input
333
+ }], defaultValue: [{
334
+ type: Input
335
+ }], valuesSet: [{
336
+ type: Output
337
+ }] } });
338
+
339
+ /*
340
+ * Copyright 2015-2020 Ritense BV, the Netherlands.
341
+ *
342
+ * Licensed under EUPL, Version 1.2 (the "License");
343
+ * you may not use this file except in compliance with the License.
344
+ * You may obtain a copy of the License at
345
+ *
346
+ * https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12
347
+ *
348
+ * Unless required by applicable law or agreed to in writing, software
349
+ * distributed under the License is distributed on an "AS IS" basis,
350
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
351
+ * See the License for the specific language governing permissions and
352
+ * limitations under the License.
353
+ */
354
+ class EditConnectorPropertiesComponent {
355
+ constructor(stateService) {
356
+ this.stateService = stateService;
357
+ this.withDefaults = false;
358
+ this.showDeleteButton = false;
359
+ this.showSaveButton = true;
360
+ this.propertiesSave = new EventEmitter();
361
+ this.connectorDelete = new EventEmitter();
362
+ this.modifiedProperties$ = new BehaviorSubject(undefined);
363
+ this.editFields$ = new BehaviorSubject([]);
364
+ this.connectorName$ = new BehaviorSubject('');
365
+ this.saveButtonDisabled$ = this.stateService.saveButtonDisabled$;
366
+ this.disabled$ = this.stateService.inputDisabled$;
367
+ }
368
+ ngOnInit() {
369
+ this.setEditFields();
370
+ this.setName();
371
+ this.openSaveButtonDisabledSubscription();
372
+ this.openSaveSubscription();
373
+ this.openDeleteSubscription();
374
+ this.stateService.showModalSaveButton();
375
+ }
376
+ ngOnChanges() {
377
+ this.setEditFields();
378
+ this.setName();
379
+ }
380
+ ngOnDestroy() {
381
+ var _a, _b, _c;
382
+ (_a = this.saveButtonDisabledSubscription) === null || _a === void 0 ? void 0 : _a.unsubscribe();
383
+ (_b = this.saveSubscription) === null || _b === void 0 ? void 0 : _b.unsubscribe();
384
+ (_c = this.deleteSubscription) === null || _c === void 0 ? void 0 : _c.unsubscribe();
385
+ }
386
+ multiFieldValuesSet(event) {
387
+ this.modifiedProperties$.pipe(take(1)).subscribe(properties => {
388
+ set(properties, event.editFieldKey, event.values);
389
+ this.modifiedProperties$.next(properties);
390
+ });
391
+ }
392
+ onSingleValueChange(value, editField) {
393
+ this.modifiedProperties$.pipe(take(1)).subscribe(properties => {
394
+ set(properties, editField.key, editField.editType === 'string' ? value.trim() : parseInt(value, 10));
395
+ this.modifiedProperties$.next(properties);
396
+ });
397
+ }
398
+ onNameValueChange(value) {
399
+ this.connectorName$.next(value.trim());
400
+ }
401
+ onSave() {
402
+ this.stateService.disableInput();
403
+ combineLatest([this.modifiedProperties$, this.connectorName$])
404
+ .pipe(take(1))
405
+ .subscribe(([properties, name]) => {
406
+ this.propertiesSave.emit({ properties, name });
407
+ });
408
+ }
409
+ onDelete() {
410
+ this.stateService.disableInput();
411
+ this.connectorDelete.emit();
412
+ }
413
+ setName() {
414
+ if (this.withDefaults && this.defaultName) {
415
+ this.connectorName$.next(this.defaultName);
416
+ }
417
+ else {
418
+ this.connectorName$.next('');
419
+ }
420
+ }
421
+ setModifiedProperties(editFields) {
422
+ const propertiesCopy = cloneDeep(this.properties);
423
+ if (!this.withDefaults) {
424
+ editFields.forEach(editField => {
425
+ set(propertiesCopy, editField.key, undefined);
426
+ });
427
+ }
428
+ this.modifiedProperties$.next(propertiesCopy);
429
+ }
430
+ setEditFields() {
431
+ const editFields = [];
432
+ const keysToFilter = ['className'];
433
+ const handlePropertyLevel = (propertyLevel, previousKeys) => {
434
+ const propertyLevelKeys = Object.keys(propertyLevel).filter(key => !keysToFilter.includes(key));
435
+ propertyLevelKeys.forEach(key => {
436
+ const propertyValue = propertyLevel[key];
437
+ const baseEditField = Object.assign({ key: previousKeys + key }, (this.withDefaults && { defaultValue: propertyValue }));
438
+ if (typeof propertyValue === 'number') {
439
+ editFields.push(Object.assign(Object.assign({}, baseEditField), { editType: 'number' }));
440
+ }
441
+ else if (Array.isArray(propertyValue)) {
442
+ if (propertyValue[0] && typeof propertyValue[0] === 'number') {
443
+ editFields.push(Object.assign(Object.assign({}, baseEditField), { editType: 'number[]' }));
444
+ }
445
+ else {
446
+ editFields.push(Object.assign(Object.assign({}, baseEditField), { editType: 'string[]' }));
447
+ }
448
+ }
449
+ else if (typeof propertyValue === 'string') {
450
+ editFields.push(Object.assign(Object.assign({}, baseEditField), { editType: 'string' }));
451
+ }
452
+ else if (typeof propertyValue === 'object') {
453
+ handlePropertyLevel(propertyValue, `${previousKeys}${key}.`);
454
+ }
455
+ });
456
+ };
457
+ handlePropertyLevel(this.properties, '');
458
+ this.editFields$.next(editFields);
459
+ this.setModifiedProperties(editFields);
460
+ }
461
+ openSaveButtonDisabledSubscription() {
462
+ this.saveButtonDisabledSubscription = combineLatest([
463
+ this.editFields$,
464
+ this.modifiedProperties$,
465
+ this.connectorName$,
466
+ ])
467
+ .pipe(map(([editFields, modifiedProperties, connectorName]) => {
468
+ const values = editFields.map(field => get(modifiedProperties, field.key));
469
+ const validValues = values.filter(value => Array.isArray(value) ? value.length > 0 : value === 0 || value);
470
+ const invalidProperties = editFields.length !== validValues.length || !connectorName;
471
+ if (invalidProperties) {
472
+ this.stateService.disableSaveButton();
473
+ }
474
+ else {
475
+ this.stateService.enableSaveButton();
476
+ }
477
+ }))
478
+ .subscribe();
479
+ }
480
+ openSaveSubscription() {
481
+ this.saveSubscription = this.stateService.save$.subscribe(() => {
482
+ this.onSave();
483
+ });
484
+ }
485
+ openDeleteSubscription() {
486
+ this.deleteSubscription = this.stateService.delete$.subscribe(() => {
487
+ this.onDelete();
488
+ });
489
+ }
490
+ }
491
+ EditConnectorPropertiesComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.9", ngImport: i0, type: EditConnectorPropertiesComponent, deps: [{ token: ConnectorManagementStateService }], target: i0.ɵɵFactoryTarget.Component });
492
+ 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 } });
493
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.9", ngImport: i0, type: EditConnectorPropertiesComponent, decorators: [{
494
+ type: Component,
495
+ 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"] }]
496
+ }], ctorParameters: function () { return [{ type: ConnectorManagementStateService }]; }, propDecorators: { properties: [{
497
+ type: Input
498
+ }], withDefaults: [{
499
+ type: Input
500
+ }], showDeleteButton: [{
501
+ type: Input
502
+ }], showSaveButton: [{
503
+ type: Input
504
+ }], defaultName: [{
505
+ type: Input
506
+ }], propertiesSave: [{
507
+ type: Output
508
+ }], connectorDelete: [{
509
+ type: Output
510
+ }] } });
511
+
512
+ const editProductAanvragenConnectorForm = {
513
+ display: 'wizard',
514
+ settings: {
515
+ pdf: {
516
+ id: '1ec0f8ee-6685-5d98-a847-26f67b67d6f0',
517
+ src: 'https://files.form.io/pdf/5692b91fd1028f01000407e3/file/1ec0f8ee-6685-5d98-a847-26f67b67d6f0',
518
+ },
519
+ },
520
+ components: [
521
+ {
522
+ title: 'connectorForm.productaanvraag.step0.title',
523
+ breadcrumbClickable: true,
524
+ buttonSettings: {
525
+ previous: true,
526
+ cancel: true,
527
+ next: true,
528
+ },
529
+ navigateOnEnter: false,
530
+ saveOnEnter: false,
531
+ scrollToTop: false,
532
+ collapsible: false,
533
+ key: 'page0',
534
+ type: 'panel',
535
+ label: 'Page 0',
536
+ input: false,
537
+ tableView: false,
538
+ components: [
539
+ {
540
+ label: 'HTML',
541
+ attrs: [
542
+ {
543
+ attr: '',
544
+ value: '',
545
+ },
546
+ ],
547
+ content: 'connectorForm.productaanvraag.step0.tip',
548
+ refreshOnChange: false,
549
+ key: 'html4',
550
+ type: 'htmlelement',
551
+ input: false,
552
+ tableView: false,
553
+ },
554
+ {
555
+ key: 'productAanvraagTypes',
556
+ type: 'editgrid',
557
+ input: true,
558
+ validate: {
559
+ minLength: 1,
560
+ },
561
+ customClass: 'edit-grid-component',
562
+ components: [
563
+ {
564
+ label: 'connectorForm.productaanvraag.step0.typeMapping.productAanvraagType.label',
565
+ tooltip: 'connectorForm.productaanvraag.step0.typeMapping.productAanvraagType.tooltip',
566
+ tableView: true,
567
+ validate: {
568
+ required: true,
569
+ },
570
+ key: 'productAanvraagType',
571
+ type: 'textfield',
572
+ input: true,
573
+ },
574
+ {
575
+ label: 'connectorForm.productaanvraag.step0.typeMapping.caseDefinitionKey.label',
576
+ widget: 'choicesjs',
577
+ placeholder: 'connectorForm.productaanvraag.step0.typeMapping.caseDefinitionKey.placeholder',
578
+ tableView: true,
579
+ validate: {
580
+ required: true,
581
+ },
582
+ key: 'caseDefinitionKey',
583
+ type: 'select',
584
+ input: true,
585
+ },
586
+ {
587
+ label: 'connectorForm.productaanvraag.step0.typeMapping.processDefinitionKey.label',
588
+ widget: 'choicesjs',
589
+ tableView: true,
590
+ dataSrc: 'custom',
591
+ data: {
592
+ custom: "values = window['productRequestDefinitions'][row.caseDefinitionKey] || []",
593
+ },
594
+ dataType: 'string',
595
+ refreshOn: 'row.caseDefinitionKey',
596
+ clearOnRefresh: true,
597
+ key: 'processDefinitionKey',
598
+ type: 'select',
599
+ input: true,
600
+ validate: {
601
+ required: true,
602
+ },
603
+ placeholder: 'connectorForm.productaanvraag.step0.typeMapping.processDefinitionKey.placeholder',
604
+ },
605
+ ],
606
+ },
607
+ ],
608
+ },
609
+ {
610
+ title: 'connectorForm.productaanvraag.step1.title',
611
+ breadcrumbClickable: true,
612
+ buttonSettings: {
613
+ previous: true,
614
+ cancel: true,
615
+ next: true,
616
+ },
617
+ navigateOnEnter: false,
618
+ saveOnEnter: false,
619
+ scrollToTop: false,
620
+ collapsible: false,
621
+ key: 'page1',
622
+ type: 'panel',
623
+ label: 'Page 1',
624
+ input: false,
625
+ tableView: false,
626
+ components: [
627
+ {
628
+ label: 'HTML',
629
+ attrs: [
630
+ {
631
+ attr: '',
632
+ value: '',
633
+ },
634
+ ],
635
+ content: 'connectorForm.productaanvraag.step1.tip',
636
+ refreshOnChange: false,
637
+ key: 'html',
638
+ type: 'htmlelement',
639
+ input: false,
640
+ tableView: false,
641
+ },
642
+ {
643
+ title: 'connectorForm.productaanvraag.step1.connectors.panelTitle',
644
+ collapsible: false,
645
+ key: 'connectorFormProductaanvraagStep1ConnectorsPanelTitle',
646
+ type: 'panel',
647
+ label: 'Panel',
648
+ input: false,
649
+ tableView: false,
650
+ components: [
651
+ {
652
+ label: 'connectorForm.productaanvraag.step1.connectors.openNotificatieConnector.label',
653
+ widget: 'choicesjs',
654
+ tableView: true,
655
+ dataSrc: 'custom',
656
+ data: {
657
+ custom: "values = window['openNotificatieConnectorNames'] || []",
658
+ },
659
+ dataType: 'string',
660
+ clearOnRefresh: true,
661
+ key: 'openNotificatieConnectionName',
662
+ type: 'select',
663
+ input: true,
664
+ validate: {
665
+ required: true,
666
+ },
667
+ placeholder: 'connectorForm.productaanvraag.step1.connectors.openNotificatieConnector.placeholder',
668
+ },
669
+ {
670
+ label: 'connectorForm.productaanvraag.step1.connectors.objectsApiConnector.label',
671
+ widget: 'choicesjs',
672
+ tableView: true,
673
+ dataSrc: 'custom',
674
+ data: {
675
+ custom: "values = window['objectApiConnectorNames'] || []",
676
+ },
677
+ dataType: 'string',
678
+ clearOnRefresh: true,
679
+ key: 'objectsApiConnectionName',
680
+ type: 'select',
681
+ input: true,
682
+ validate: {
683
+ required: true,
684
+ },
685
+ placeholder: 'connectorForm.productaanvraag.step1.connectors.objectsApiConnector.placeholder',
686
+ },
687
+ ],
688
+ },
689
+ ],
690
+ },
691
+ {
692
+ title: 'connectorForm.productaanvraag.step2.title',
693
+ breadcrumbClickable: true,
694
+ buttonSettings: {
695
+ previous: true,
696
+ cancel: true,
697
+ next: true,
698
+ },
699
+ navigateOnEnter: false,
700
+ saveOnEnter: false,
701
+ scrollToTop: false,
702
+ collapsible: false,
703
+ key: 'page2',
704
+ type: 'panel',
705
+ label: 'Page 2',
706
+ input: false,
707
+ tableView: false,
708
+ components: [
709
+ {
710
+ label: 'HTML',
711
+ attrs: [
712
+ {
713
+ attr: '',
714
+ value: '',
715
+ },
716
+ ],
717
+ content: 'connectorForm.productaanvraag.step2.tip',
718
+ refreshOnChange: false,
719
+ key: 'html3',
720
+ type: 'htmlelement',
721
+ input: false,
722
+ tableView: false,
723
+ },
724
+ {
725
+ title: 'connectorForm.productaanvraag.step2.applicant.panelTitle',
726
+ collapsible: false,
727
+ key: 'connectorFormProductaanvraagstep2ApplicantPanelTitle',
728
+ type: 'panel',
729
+ label: 'Panel',
730
+ input: false,
731
+ tableView: false,
732
+ components: [
733
+ {
734
+ label: 'HTML',
735
+ attrs: [
736
+ {
737
+ attr: '',
738
+ value: '',
739
+ },
740
+ ],
741
+ content: 'connectorForm.productaanvraag.step2.applicant.tip',
742
+ refreshOnChange: false,
743
+ key: 'html5',
744
+ type: 'htmlelement',
745
+ input: false,
746
+ tableView: false,
747
+ },
748
+ {
749
+ label: 'connectorForm.productaanvraag.step2.applicant.roleTypeUrl.label',
750
+ tooltip: 'connectorForm.productaanvraag.step2.applicant.roleTypeUrl.tooltip',
751
+ tableView: true,
752
+ validate: {
753
+ required: true,
754
+ },
755
+ key: 'applicantRoleTypeUrl',
756
+ type: 'textfield',
757
+ input: true,
758
+ },
759
+ ],
760
+ },
761
+ ],
762
+ },
763
+ {
764
+ title: 'connectorForm.productaanvraag.step3.title',
765
+ breadcrumbClickable: true,
766
+ buttonSettings: {
767
+ previous: true,
768
+ cancel: true,
769
+ next: true,
770
+ },
771
+ navigateOnEnter: false,
772
+ saveOnEnter: false,
773
+ scrollToTop: false,
774
+ collapsible: false,
775
+ key: 'page3',
776
+ type: 'panel',
777
+ label: 'Page 3',
778
+ input: false,
779
+ tableView: false,
780
+ components: [
781
+ {
782
+ label: 'HTML',
783
+ attrs: [
784
+ {
785
+ attr: '',
786
+ value: '',
787
+ },
788
+ ],
789
+ content: 'connectorForm.productaanvraag.step3.tip',
790
+ refreshOnChange: false,
791
+ key: 'html6',
792
+ type: 'htmlelement',
793
+ input: false,
794
+ tableView: false,
795
+ },
796
+ {
797
+ label: 'connectorForm.productaanvraag.step3.name',
798
+ tableView: true,
799
+ validate: {
800
+ required: true,
801
+ },
802
+ key: 'connectorName',
803
+ type: 'textfield',
804
+ input: true,
805
+ },
806
+ ],
807
+ },
808
+ ],
809
+ };
810
+
811
+ /*
812
+ * Copyright 2015-2021 Ritense BV, the Netherlands.
813
+ *
814
+ * Licensed under EUPL, Version 1.2 (the "License");
815
+ * you may not use this file except in compliance with the License.
816
+ * You may obtain a copy of the License at
817
+ *
818
+ * https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12
819
+ *
820
+ * Unless required by applicable law or agreed to in writing, software
821
+ * distributed under the License is distributed on an "AS IS" basis,
822
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
823
+ * See the License for the specific language governing permissions and
824
+ * limitations under the License.
825
+ */
826
+ class EditProductAanvragenConnectorComponent {
827
+ constructor(formTranslationService, formMappingService, documentService, translateService, connectorManagementService, stateService) {
828
+ this.formTranslationService = formTranslationService;
829
+ this.formMappingService = formMappingService;
830
+ this.documentService = documentService;
831
+ this.translateService = translateService;
832
+ this.connectorManagementService = connectorManagementService;
833
+ this.stateService = stateService;
834
+ this.showDeleteButton = false;
835
+ this.propertiesSave = new EventEmitter();
836
+ this.connectorDelete = new EventEmitter();
837
+ this.formRefresh$ = new Subject();
838
+ this.formDefinition$ = new BehaviorSubject(undefined);
839
+ this.translatedFormDefinition$ = this.formDefinition$.pipe(map(definition => this.formTranslationService.translateForm(definition)));
840
+ this.caseDefinitionOptions = [];
841
+ this.processDocumentDefinitionOptions = {};
842
+ this.options = {
843
+ disableAlerts: true,
844
+ };
845
+ this.mapCaseDefinitionKeyComponent = (component) => {
846
+ if (component.key === 'caseDefinitionKey') {
847
+ return Object.assign(Object.assign({}, component), { disabled: false, data: { values: this.caseDefinitionOptions } });
848
+ }
849
+ return component;
850
+ };
851
+ }
852
+ ngOnInit() {
853
+ window['productRequestDefinitions'] = {};
854
+ this.openFormDefinitionSubscription();
855
+ this.openDeleteSubscription();
856
+ this.formDefinition$.next(editProductAanvragenConnectorForm);
857
+ this.loadConnectorNames();
858
+ this.loadDefinitions();
859
+ this.stateService.hideModalSaveButton();
860
+ }
861
+ ngOnDestroy() {
862
+ var _a, _b, _c;
863
+ (_a = this.formDefinitionSubscription) === null || _a === void 0 ? void 0 : _a.unsubscribe();
864
+ (_b = this.translateSubscription) === null || _b === void 0 ? void 0 : _b.unsubscribe();
865
+ (_c = this.deleteSubscription) === null || _c === void 0 ? void 0 : _c.unsubscribe();
866
+ }
867
+ onSubmit(event) {
868
+ const submission = event.data;
869
+ const properties = cloneDeep(this.properties);
870
+ properties.objectsApiConnectionName = submission.objectsApiConnectionName;
871
+ properties.openNotificatieConnectionName = submission.openNotificatieConnectionName;
872
+ properties.aanvragerRolTypeUrl = submission.applicantRoleTypeUrl;
873
+ properties.typeMapping = submission.productAanvraagTypes;
874
+ this.propertiesSave.emit({ properties, name: submission.connectorName });
875
+ }
876
+ onDelete() {
877
+ this.stateService.disableInput();
878
+ this.connectorDelete.emit();
879
+ }
880
+ openFormDefinitionSubscription() {
881
+ this.formDefinitionSubscription = combineLatest([
882
+ this.formDefinition$,
883
+ this.translateService.stream('key'),
884
+ ]).subscribe(([form]) => {
885
+ const translatedForm = this.formTranslationService.translateForm(form);
886
+ this.refreshForm({ form: translatedForm });
887
+ });
888
+ }
889
+ prefillForm() {
890
+ const properties = cloneDeep(this.properties);
891
+ const submission = {};
892
+ submission.objectsApiConnectionName = properties.objectsApiConnectionName;
893
+ submission.openNotificatieConnectionName = properties.openNotificatieConnectionName;
894
+ submission.applicantRoleTypeUrl = properties.aanvragerRolTypeUrl;
895
+ submission.productAanvraagTypes = properties.typeMapping;
896
+ submission.connectorName = this.defaultName;
897
+ this.refreshForm({ submission: { data: submission } });
898
+ }
899
+ refreshForm(refreshValue) {
900
+ this.formRefresh$.next(refreshValue);
901
+ }
902
+ loadDefinitions() {
903
+ let documentDefinitions;
904
+ this.documentService
905
+ .getAllDefinitions()
906
+ .pipe(tap(resDocumentDefinitions => (documentDefinitions = resDocumentDefinitions.content)), switchMap(resDocumentDefinitions => combineLatest(resDocumentDefinitions.content.map(definition => this.documentService.findProcessDocumentDefinitions(definition.id.name)))), tap(res => {
907
+ var _a;
908
+ this.caseDefinitionOptions = documentDefinitions.map(documentDefinition => ({
909
+ label: documentDefinition.id.name,
910
+ value: documentDefinition.id.name,
911
+ }));
912
+ documentDefinitions.forEach((documentDefinition, index) => {
913
+ this.processDocumentDefinitionOptions[documentDefinition.id.name] = res[index].map(processDocumentDefinition => processDocumentDefinition.id.processDefinitionKey);
914
+ });
915
+ window['productRequestDefinitions'] = this.processDocumentDefinitionOptions;
916
+ const definitionWithCaseDefinitionOptions = this.formMappingService.mapComponents(this.formDefinition$.getValue(), this.mapCaseDefinitionKeyComponent);
917
+ this.formDefinition$.next(definitionWithCaseDefinitionOptions);
918
+ if ((_a = this.properties) === null || _a === void 0 ? void 0 : _a.aanvragerRolTypeUrl) {
919
+ this.prefillForm();
920
+ }
921
+ }))
922
+ .subscribe();
923
+ }
924
+ loadConnectorNames() {
925
+ this.connectorManagementService
926
+ .getConnectorTypes()
927
+ .pipe(tap(res => {
928
+ res.forEach(connectorType => {
929
+ if (connectorType.name === 'ObjectsApi') {
930
+ this.loadConnectorNamesByType('objectApiConnectorNames', connectorType.id);
931
+ }
932
+ else if (connectorType.name === 'OpenNotificatie') {
933
+ this.loadConnectorNamesByType('openNotificatieConnectorNames', connectorType.id);
934
+ }
935
+ });
936
+ }))
937
+ .subscribe();
938
+ }
939
+ loadConnectorNamesByType(windowKey, connectorTypeId) {
940
+ this.connectorManagementService
941
+ .getConnectorInstancesByType(connectorTypeId)
942
+ .pipe(map(res => (window[windowKey] = res.content.map(connector => connector.name))))
943
+ .subscribe();
944
+ }
945
+ openDeleteSubscription() {
946
+ this.deleteSubscription = this.stateService.delete$.subscribe(() => {
947
+ this.onDelete();
948
+ });
949
+ }
950
+ }
951
+ 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 });
952
+ 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 } });
953
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.9", ngImport: i0, type: EditProductAanvragenConnectorComponent, decorators: [{
954
+ type: Component,
955
+ 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"] }]
956
+ }], 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: [{
957
+ type: Input
958
+ }], defaultName: [{
959
+ type: Input
960
+ }], showDeleteButton: [{
961
+ type: Input
962
+ }], propertiesSave: [{
963
+ type: Output
964
+ }], connectorDelete: [{
965
+ type: Output
966
+ }] } });
967
+
968
+ const editTaakConnectorForm = {
969
+ components: [
970
+ {
971
+ label: 'connectorForm.taak.name',
972
+ tableView: false,
973
+ validate: {
974
+ required: true,
975
+ },
976
+ key: 'connectorName',
977
+ type: 'textfield',
978
+ input: true,
979
+ },
980
+ {
981
+ label: 'connectorForm.taak.openNotificatieConnector.label',
982
+ widget: 'choicesjs',
983
+ tableView: false,
984
+ dataSrc: 'custom',
985
+ data: {
986
+ custom: "values = window['openNotificatieConnectorNames'] || []",
987
+ },
988
+ dataType: 'string',
989
+ clearOnRefresh: true,
990
+ key: 'openNotificatieConnectionName',
991
+ type: 'select',
992
+ input: true,
993
+ validate: {
994
+ required: true,
995
+ },
996
+ placeholder: 'connectorForm.taak.openNotificatieConnector.placeholder',
997
+ },
998
+ {
999
+ label: 'connectorForm.taak.objectsApiConnector.label',
1000
+ widget: 'choicesjs',
1001
+ tableView: false,
1002
+ dataSrc: 'custom',
1003
+ data: {
1004
+ custom: "values = window['objectApiConnectorNames'] || []",
1005
+ },
1006
+ dataType: 'string',
1007
+ clearOnRefresh: true,
1008
+ key: 'objectsApiConnectionName',
1009
+ type: 'select',
1010
+ input: true,
1011
+ validate: {
1012
+ required: true,
1013
+ },
1014
+ placeholder: 'connectorForm.taak.objectsApiConnector.placeholder',
1015
+ },
1016
+ {
1017
+ key: 'submit',
1018
+ type: 'button',
1019
+ customClass: 'list-inline',
1020
+ leftIcon: 'icon mdi mdi-save mt-1',
1021
+ input: true,
1022
+ label: 'connectorManagement.save',
1023
+ tableView: false,
1024
+ disableOnInvalid: true,
1025
+ },
1026
+ ],
1027
+ };
1028
+
1029
+ /*
1030
+ * Copyright 2015-2022 Ritense BV, the Netherlands.
1031
+ *
1032
+ * Licensed under EUPL, Version 1.2 (the "License");
1033
+ * you may not use this file except in compliance with the License.
1034
+ * You may obtain a copy of the License at
1035
+ *
1036
+ * https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12
1037
+ *
1038
+ * Unless required by applicable law or agreed to in writing, software
1039
+ * distributed under the License is distributed on an "AS IS" basis,
1040
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1041
+ * See the License for the specific language governing permissions and
1042
+ * limitations under the License.
1043
+ */
1044
+ class EditTaakConnectorComponent {
1045
+ constructor(formTranslationService, formMappingService, translateService, connectorManagementService, stateService) {
1046
+ this.formTranslationService = formTranslationService;
1047
+ this.formMappingService = formMappingService;
1048
+ this.translateService = translateService;
1049
+ this.connectorManagementService = connectorManagementService;
1050
+ this.stateService = stateService;
1051
+ this.showDeleteButton = false;
1052
+ this.propertiesSave = new EventEmitter();
1053
+ this.connectorDelete = new EventEmitter();
1054
+ this.formRefresh$ = new Subject();
1055
+ this.formDefinition$ = new BehaviorSubject(undefined);
1056
+ this.translatedFormDefinition$ = this.formDefinition$.pipe(map(definition => this.formTranslationService.translateForm(definition)));
1057
+ this.options = {
1058
+ disableAlerts: true,
1059
+ };
1060
+ }
1061
+ ngOnInit() {
1062
+ this.openFormDefinitionSubscription();
1063
+ this.openDeleteSubscription();
1064
+ this.formDefinition$.next(editTaakConnectorForm);
1065
+ this.loadConnectorNames();
1066
+ this.prefillForm();
1067
+ this.stateService.hideModalSaveButton();
1068
+ }
1069
+ ngOnDestroy() {
1070
+ var _a, _b, _c;
1071
+ (_a = this.formDefinitionSubscription) === null || _a === void 0 ? void 0 : _a.unsubscribe();
1072
+ (_b = this.translateSubscription) === null || _b === void 0 ? void 0 : _b.unsubscribe();
1073
+ (_c = this.deleteSubscription) === null || _c === void 0 ? void 0 : _c.unsubscribe();
1074
+ }
1075
+ onSubmit(event) {
1076
+ const submission = event.data;
1077
+ const properties = cloneDeep(this.properties);
1078
+ properties.objectsApiConnectionName = submission.objectsApiConnectionName;
1079
+ properties.openNotificatieConnectionName = submission.openNotificatieConnectionName;
1080
+ this.propertiesSave.emit({ properties, name: submission.connectorName });
1081
+ }
1082
+ onDelete() {
1083
+ this.stateService.disableInput();
1084
+ this.connectorDelete.emit();
1085
+ }
1086
+ openFormDefinitionSubscription() {
1087
+ this.formDefinitionSubscription = combineLatest([
1088
+ this.formDefinition$,
1089
+ this.translateService.stream('key'),
1090
+ ]).subscribe(([form]) => {
1091
+ const translatedForm = this.formTranslationService.translateForm(form);
1092
+ this.refreshForm({ form: translatedForm });
1093
+ });
1094
+ }
1095
+ prefillForm() {
1096
+ timer(100)
1097
+ .pipe(tap(() => {
1098
+ if (this.defaultName !== undefined) {
1099
+ const properties = cloneDeep(this.properties);
1100
+ const submission = {};
1101
+ submission.objectsApiConnectionName = properties.objectsApiConnectionName;
1102
+ submission.openNotificatieConnectionName = properties.openNotificatieConnectionName;
1103
+ submission.connectorName = this.defaultName;
1104
+ this.refreshForm({ submission: { data: submission } });
1105
+ }
1106
+ }))
1107
+ .subscribe();
1108
+ }
1109
+ refreshForm(refreshValue) {
1110
+ this.formRefresh$.next(refreshValue);
1111
+ }
1112
+ loadConnectorNames() {
1113
+ this.connectorManagementService
1114
+ .getConnectorTypes()
1115
+ .pipe(tap(res => {
1116
+ res.forEach(connectorType => {
1117
+ if (connectorType.name === 'ObjectsApi') {
1118
+ this.loadConnectorNamesByType('objectApiConnectorNames', connectorType.id);
1119
+ }
1120
+ else if (connectorType.name === 'OpenNotificatie') {
1121
+ this.loadConnectorNamesByType('openNotificatieConnectorNames', connectorType.id);
1122
+ }
1123
+ });
1124
+ }))
1125
+ .subscribe();
1126
+ }
1127
+ loadConnectorNamesByType(windowKey, connectorTypeId) {
1128
+ this.connectorManagementService
1129
+ .getConnectorInstancesByType(connectorTypeId)
1130
+ .pipe(map(res => (window[windowKey] = res.content.map(connector => connector.name))))
1131
+ .subscribe();
1132
+ }
1133
+ openDeleteSubscription() {
1134
+ this.deleteSubscription = this.stateService.delete$.subscribe(() => {
1135
+ this.onDelete();
1136
+ });
1137
+ }
1138
+ }
1139
+ 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 });
1140
+ 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 } });
1141
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.9", ngImport: i0, type: EditTaakConnectorComponent, decorators: [{
1142
+ type: Component,
1143
+ 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"] }]
1144
+ }], ctorParameters: function () { return [{ type: i1$1.FormTranslationService }, { type: i1$1.FormMappingService }, { type: i2$1.TranslateService }, { type: ConnectorManagementService }, { type: ConnectorManagementStateService }]; }, propDecorators: { properties: [{
1145
+ type: Input
1146
+ }], defaultName: [{
1147
+ type: Input
1148
+ }], showDeleteButton: [{
1149
+ type: Input
1150
+ }], propertiesSave: [{
1151
+ type: Output
1152
+ }], connectorDelete: [{
1153
+ type: Output
1154
+ }] } });
1155
+
1156
+ /*
1157
+ * Copyright 2015-2020 Ritense BV, the Netherlands.
1158
+ *
1159
+ * Licensed under EUPL, Version 1.2 (the "License");
1160
+ * you may not use this file except in compliance with the License.
1161
+ * You may obtain a copy of the License at
1162
+ *
1163
+ * https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12
1164
+ *
1165
+ * Unless required by applicable law or agreed to in writing, software
1166
+ * distributed under the License is distributed on an "AS IS" basis,
1167
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1168
+ * See the License for the specific language governing permissions and
1169
+ * limitations under the License.
1170
+ */
1171
+ class EditConnectorFormComponent {
1172
+ constructor() {
1173
+ this.withDefaults = false;
1174
+ this.showDeleteButton = false;
1175
+ this.showSaveButton = true;
1176
+ this.propertiesSave = new EventEmitter();
1177
+ this.connectorDelete = new EventEmitter();
1178
+ this.productAanvragenName = 'ProductAanvragen';
1179
+ this.taakName = 'Taak';
1180
+ this.customConnectorNames = [this.productAanvragenName, this.taakName];
1181
+ }
1182
+ }
1183
+ EditConnectorFormComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.9", ngImport: i0, type: EditConnectorFormComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
1184
+ 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"] }] });
1185
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.9", ngImport: i0, type: EditConnectorFormComponent, decorators: [{
1186
+ type: Component,
1187
+ 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"] }]
1188
+ }], propDecorators: { properties: [{
1189
+ type: Input
1190
+ }], withDefaults: [{
1191
+ type: Input
1192
+ }], showDeleteButton: [{
1193
+ type: Input
1194
+ }], showSaveButton: [{
1195
+ type: Input
1196
+ }], defaultName: [{
1197
+ type: Input
1198
+ }], connectorName: [{
1199
+ type: Input
1200
+ }], propertiesSave: [{
1201
+ type: Output
1202
+ }], connectorDelete: [{
1203
+ type: Output
1204
+ }] } });
1205
+
1206
+ /*
1207
+ * Copyright 2015-2020 Ritense BV, the Netherlands.
1208
+ *
1209
+ * Licensed under EUPL, Version 1.2 (the "License");
1210
+ * you may not use this file except in compliance with the License.
1211
+ * You may obtain a copy of the License at
1212
+ *
1213
+ * https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12
1214
+ *
1215
+ * Unless required by applicable law or agreed to in writing, software
1216
+ * distributed under the License is distributed on an "AS IS" basis,
1217
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1218
+ * See the License for the specific language governing permissions and
1219
+ * limitations under the License.
1220
+ */
1221
+ class ModifyConnectorComponent {
1222
+ constructor(connectorManagementService, stateService, alertService, translateService) {
1223
+ this.connectorManagementService = connectorManagementService;
1224
+ this.stateService = stateService;
1225
+ this.alertService = alertService;
1226
+ this.translateService = translateService;
1227
+ this.showSaveButton = true;
1228
+ this.showDeleteButton = true;
1229
+ this.instance$ = this.stateService.selectedInstance$;
1230
+ }
1231
+ onSave(event) {
1232
+ this.stateService.disableInput();
1233
+ this.instance$.pipe(take(1)).subscribe(instance => {
1234
+ this.connectorManagementService
1235
+ .updateConnectorInstance({
1236
+ name: event.name,
1237
+ typeId: instance.type.id,
1238
+ id: instance.id,
1239
+ connectorProperties: event.properties,
1240
+ })
1241
+ .subscribe(() => {
1242
+ this.alertService.success(this.translateService.instant('connectorManagement.messages.modifySuccess'));
1243
+ this.stateService.hideModal();
1244
+ this.stateService.enableInput();
1245
+ this.stateService.refresh();
1246
+ }, () => {
1247
+ this.stateService.enableInput();
1248
+ });
1249
+ });
1250
+ }
1251
+ onDelete() {
1252
+ this.stateService.disableInput();
1253
+ this.instance$.pipe(take(1)).subscribe(instance => {
1254
+ this.connectorManagementService.deleteConnectorInstance(instance.id).subscribe(() => {
1255
+ this.alertService.success(this.translateService.instant('connectorManagement.messages.deleteSuccess'));
1256
+ this.stateService.hideModal();
1257
+ this.stateService.enableInput();
1258
+ this.stateService.refresh();
1259
+ }, () => {
1260
+ this.stateService.enableInput();
1261
+ });
1262
+ });
1263
+ }
1264
+ }
1265
+ 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 });
1266
+ 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 } });
1267
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.9", ngImport: i0, type: ModifyConnectorComponent, decorators: [{
1268
+ type: Component,
1269
+ 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"] }]
1270
+ }], ctorParameters: function () { return [{ type: ConnectorManagementService }, { type: ConnectorManagementStateService }, { type: i6$1.AlertService }, { type: i2$1.TranslateService }]; }, propDecorators: { showSaveButton: [{
1271
+ type: Input
1272
+ }], showDeleteButton: [{
1273
+ type: Input
1274
+ }] } });
1275
+
1276
+ /*
1277
+ * Copyright 2015-2020 Ritense BV, the Netherlands.
1278
+ *
1279
+ * Licensed under EUPL, Version 1.2 (the "License");
1280
+ * you may not use this file except in compliance with the License.
1281
+ * You may obtain a copy of the License at
1282
+ *
1283
+ * https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12
1284
+ *
1285
+ * Unless required by applicable law or agreed to in writing, software
1286
+ * distributed under the License is distributed on an "AS IS" basis,
1287
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1288
+ * See the License for the specific language governing permissions and
1289
+ * limitations under the License.
1290
+ */
1291
+ class AddConnectorSelectComponent {
1292
+ constructor(connectorManagementService, stateService, translateService) {
1293
+ this.connectorManagementService = connectorManagementService;
1294
+ this.stateService = stateService;
1295
+ this.translateService = translateService;
1296
+ this.selectedConnector$ = this.stateService.selectedConnector$;
1297
+ this.disabled$ = this.stateService.inputDisabled$;
1298
+ this.connectorTypes$ = this.stateService.connectorTypes$;
1299
+ }
1300
+ ngOnInit() {
1301
+ this.openRefreshSubscription();
1302
+ this.getConnectorTypes();
1303
+ }
1304
+ ngOnDestroy() {
1305
+ var _a;
1306
+ (_a = this.refreshSubscription) === null || _a === void 0 ? void 0 : _a.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
+ var _a, _b;
1424
+ (_a = this.showSubscription) === null || _a === void 0 ? void 0 : _a.unsubscribe();
1425
+ (_b = this.hideSubscription) === null || _b === void 0 ? void 0 : _b.unsubscribe();
1426
+ }
1427
+ hide() {
1428
+ this.stateService.disableInput();
1429
+ this.modalService.closeModal();
1430
+ this.modalService.appearingDelayMs$.pipe(take(1)).subscribe(appearingDelay => {
1431
+ setTimeout(() => {
1432
+ this.returnToFirstStep();
1433
+ this.stateService.enableInput();
1434
+ this.stateService.clearSelectedConnector();
1435
+ }, appearingDelay);
1436
+ });
1437
+ }
1438
+ complete() {
1439
+ this.stateService.save();
1440
+ }
1441
+ delete() {
1442
+ this.stateService.delete();
1443
+ }
1444
+ openShowSubscription() {
1445
+ this.showSubscription = this.stateService.showModal$.subscribe(() => {
1446
+ this.show();
1447
+ });
1448
+ }
1449
+ openHideSubscription() {
1450
+ this.hideSubscription = this.stateService.hideModal$.subscribe(() => {
1451
+ this.hide();
1452
+ });
1453
+ }
1454
+ returnToFirstStep() {
1455
+ this.returnToFirstStepSubject$.next(true);
1456
+ }
1457
+ show() {
1458
+ this.stateService.modalType$.pipe(take(1)).subscribe(modalType => {
1459
+ if (modalType === 'add') {
1460
+ this.modalService.openModal(this.connectorCreateModal);
1461
+ }
1462
+ else if (modalType === 'modify') {
1463
+ this.modalService.openModal(this.connectorEditModal);
1464
+ }
1465
+ });
1466
+ }
1467
+ }
1468
+ 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 });
1469
+ 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 } });
1470
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.9", ngImport: i0, type: ConnectorModalComponent, decorators: [{
1471
+ type: Component,
1472
+ 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"] }]
1473
+ }], ctorParameters: function () { return [{ type: ConnectorManagementStateService }, { type: i2$2.ModalService }]; }, propDecorators: { connectorCreateModal: [{
1474
+ type: ViewChild,
1475
+ args: ['connectorCreateModal']
1476
+ }], connectorEditModal: [{
1477
+ type: ViewChild,
1478
+ args: ['connectorEditModal']
1479
+ }] } });
1480
+
1481
+ /*
1482
+ * Copyright 2015-2020 Ritense BV, the Netherlands.
1483
+ *
1484
+ * Licensed under EUPL, Version 1.2 (the "License");
1485
+ * you may not use this file except in compliance with the License.
1486
+ * You may obtain a copy of the License at
1487
+ *
1488
+ * https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12
1489
+ *
1490
+ * Unless required by applicable law or agreed to in writing, software
1491
+ * distributed under the License is distributed on an "AS IS" basis,
1492
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1493
+ * See the License for the specific language governing permissions and
1494
+ * limitations under the License.
1495
+ */
1496
+ class ConnectorManagementComponent {
1497
+ constructor(connectorManagementService, translateService, stateService) {
1498
+ this.connectorManagementService = connectorManagementService;
1499
+ this.translateService = translateService;
1500
+ this.stateService = stateService;
1501
+ this.loading$ = new BehaviorSubject(true);
1502
+ this.fields$ = new BehaviorSubject([]);
1503
+ this.columns$ = this.fields$.pipe(map(fields => fields.map(field => ({
1504
+ dataKey: field.key,
1505
+ labelTranslationKey: field.label,
1506
+ }))));
1507
+ this.currentPageAndSize$ = new BehaviorSubject({
1508
+ page: 0,
1509
+ size: 10,
1510
+ });
1511
+ this.pageSizes$ = new BehaviorSubject({
1512
+ collectionSize: 0,
1513
+ maxPaginationItemSize: 5,
1514
+ });
1515
+ this.pagination$ = combineLatest([
1516
+ this.currentPageAndSize$,
1517
+ this.pageSizes$,
1518
+ ]).pipe(map(([currentPage, sizes]) => (Object.assign(Object.assign(Object.assign({}, currentPage), sizes), { page: currentPage.page + 1 }))));
1519
+ this.connectorInstances$ = combineLatest([
1520
+ this.currentPageAndSize$,
1521
+ this.translateService.stream('key'),
1522
+ this.stateService.refresh$,
1523
+ ]).pipe(tap(() => this.setFields()), switchMap(([currentPage]) => combineLatest([
1524
+ this.connectorManagementService.getConnectorInstances({
1525
+ page: currentPage.page,
1526
+ size: currentPage.size,
1527
+ }),
1528
+ this.connectorManagementService.getConnectorTypes(),
1529
+ ])), tap(([instanceRes]) => {
1530
+ this.pageSizes$.pipe(take(1)).subscribe(sizes => {
1531
+ this.pageSizes$.next(Object.assign(Object.assign({}, sizes), { collectionSize: instanceRes.totalElements }));
1532
+ });
1533
+ }), map(([instanceRes, typesRes]) => instanceRes.content.map(instance => {
1534
+ var _a;
1535
+ return (Object.assign(Object.assign({}, instance), { typeName: (_a = typesRes.find(type => type.id === instance.type.id)) === null || _a === void 0 ? void 0 : _a.name }));
1536
+ })), tap(() => this.loading$.next(false)));
1537
+ }
1538
+ ngOnDestroy() {
1539
+ this.stateService.hideModal();
1540
+ }
1541
+ paginationClicked(newPageNumber) {
1542
+ this.currentPageAndSize$.pipe(take(1)).subscribe(currentPage => {
1543
+ this.currentPageAndSize$.next(Object.assign(Object.assign({}, currentPage), { page: newPageNumber - 1 }));
1544
+ });
1545
+ }
1546
+ paginationSet(newPageSize) {
1547
+ if (newPageSize) {
1548
+ this.currentPageAndSize$.pipe(take(1)).subscribe(currentPage => {
1549
+ this.currentPageAndSize$.next(Object.assign(Object.assign({}, currentPage), { size: newPageSize }));
1550
+ });
1551
+ }
1552
+ }
1553
+ rowClicked(instance) {
1554
+ this.stateService.setModalType('modify');
1555
+ this.stateService.setConnectorInstance(instance);
1556
+ this.stateService.showModal();
1557
+ }
1558
+ showAddModal() {
1559
+ this.stateService.setModalType('add');
1560
+ this.stateService.showModal();
1561
+ }
1562
+ setFields() {
1563
+ const keys = ['name', 'typeName'];
1564
+ this.fields$.next(keys.map(key => ({ label: `connectorManagement.labels.${key}`, key })));
1565
+ }
1566
+ }
1567
+ 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 });
1568
+ 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 } });
1569
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.9", ngImport: i0, type: ConnectorManagementComponent, decorators: [{
1570
+ type: Component,
1571
+ 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"] }]
1572
+ }], ctorParameters: function () { return [{ type: ConnectorManagementService }, { type: i2$1.TranslateService }, { type: ConnectorManagementStateService }]; } });
1573
+
1574
+ /*
1575
+ * Copyright 2015-2020 Ritense BV, the Netherlands.
1576
+ *
1577
+ * Licensed under EUPL, Version 1.2 (the "License");
1578
+ * you may not use this file except in compliance with the License.
1579
+ * You may obtain a copy of the License at
1580
+ *
1581
+ * https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12
1582
+ *
1583
+ * Unless required by applicable law or agreed to in writing, software
1584
+ * distributed under the License is distributed on an "AS IS" basis,
1585
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1586
+ * See the License for the specific language governing permissions and
1587
+ * limitations under the License.
1588
+ */
1589
+ const routes = [
1590
+ {
1591
+ path: 'connectors',
1592
+ component: ConnectorManagementComponent,
1593
+ canActivate: [AuthGuardService],
1594
+ data: { title: 'Connectors', roles: [ROLE_ADMIN] },
1595
+ },
1596
+ ];
1597
+ class ConnectorManagementRoutingModule {
1598
+ }
1599
+ ConnectorManagementRoutingModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.9", ngImport: i0, type: ConnectorManagementRoutingModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
1600
+ ConnectorManagementRoutingModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "12.0.0", version: "13.3.9", ngImport: i0, type: ConnectorManagementRoutingModule, imports: [CommonModule, i5.RouterModule], exports: [RouterModule] });
1601
+ ConnectorManagementRoutingModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "13.3.9", ngImport: i0, type: ConnectorManagementRoutingModule, imports: [[CommonModule, RouterModule.forChild(routes)], RouterModule] });
1602
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.9", ngImport: i0, type: ConnectorManagementRoutingModule, decorators: [{
1603
+ type: NgModule,
1604
+ args: [{
1605
+ declarations: [],
1606
+ imports: [CommonModule, RouterModule.forChild(routes)],
1607
+ exports: [RouterModule],
1608
+ }]
1609
+ }] });
1610
+
1611
+ /*
1612
+ * Copyright 2015-2020 Ritense BV, the Netherlands.
1613
+ *
1614
+ * Licensed under EUPL, Version 1.2 (the "License");
1615
+ * you may not use this file except in compliance with the License.
1616
+ * You may obtain a copy of the License at
1617
+ *
1618
+ * https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12
1619
+ *
1620
+ * Unless required by applicable law or agreed to in writing, software
1621
+ * distributed under the License is distributed on an "AS IS" basis,
1622
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1623
+ * See the License for the specific language governing permissions and
1624
+ * limitations under the License.
1625
+ */
1626
+ class ObjectApiSyncService {
1627
+ constructor(http, configService) {
1628
+ this.http = http;
1629
+ this.configService = configService;
1630
+ this.valtimoApiConfig = configService.config.valtimoApi;
1631
+ }
1632
+ getObjectSyncConfigs(documentDefinitionName) {
1633
+ return this.http.get(`${this.valtimoApiConfig.endpointUri}object/sync/config`, { params: { documentDefinitionName } });
1634
+ }
1635
+ createObjectSyncConfig(request) {
1636
+ return this.http.post(`${this.valtimoApiConfig.endpointUri}object/sync/config`, request);
1637
+ }
1638
+ modifyObjectSyncConfig(request) {
1639
+ return this.http.put(`${this.valtimoApiConfig.endpointUri}object/sync/config`, request);
1640
+ }
1641
+ deleteObjectSyncConfig(configId) {
1642
+ return this.http.delete(`${this.valtimoApiConfig.endpointUri}object/sync/config/${configId}`);
1643
+ }
1644
+ }
1645
+ 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 });
1646
+ ObjectApiSyncService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "13.3.9", ngImport: i0, type: ObjectApiSyncService, providedIn: 'root' });
1647
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.9", ngImport: i0, type: ObjectApiSyncService, decorators: [{
1648
+ type: Injectable,
1649
+ args: [{
1650
+ providedIn: 'root',
1651
+ }]
1652
+ }], ctorParameters: function () { return [{ type: i1.HttpClient }, { type: i2.ConfigService }]; } });
1653
+
1654
+ /*
1655
+ * Copyright 2015-2020 Ritense BV, the Netherlands.
1656
+ *
1657
+ * Licensed under EUPL, Version 1.2 (the "License");
1658
+ * you may not use this file except in compliance with the License.
1659
+ * You may obtain a copy of the License at
1660
+ *
1661
+ * https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12
1662
+ *
1663
+ * Unless required by applicable law or agreed to in writing, software
1664
+ * distributed under the License is distributed on an "AS IS" basis,
1665
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1666
+ * See the License for the specific language governing permissions and
1667
+ * limitations under the License.
1668
+ */
1669
+ class ConnectorLinkExtensionModalComponent {
1670
+ constructor(connectorManagementService, translateService, stateService, objectApiSyncService, route, alertService) {
1671
+ this.connectorManagementService = connectorManagementService;
1672
+ this.translateService = translateService;
1673
+ this.stateService = stateService;
1674
+ this.objectApiSyncService = objectApiSyncService;
1675
+ this.route = route;
1676
+ this.alertService = alertService;
1677
+ this.loading$ = new BehaviorSubject(true);
1678
+ this.fields$ = new BehaviorSubject([]);
1679
+ this.currentPageAndSize$ = new BehaviorSubject({
1680
+ page: 0,
1681
+ size: 10,
1682
+ });
1683
+ this.pageSizes$ = new BehaviorSubject({
1684
+ collectionSize: 0,
1685
+ maxPaginationItemSize: 5,
1686
+ });
1687
+ this.pagination$ = combineLatest([
1688
+ this.currentPageAndSize$,
1689
+ this.pageSizes$,
1690
+ ]).pipe(map(([currentPage, sizes]) => (Object.assign(Object.assign(Object.assign({}, currentPage), sizes), { page: currentPage.page + 1 }))));
1691
+ this.connectorInstances$ = combineLatest([
1692
+ this.currentPageAndSize$,
1693
+ this.connectorManagementService.getConnectorTypes(),
1694
+ this.translateService.stream('key'),
1695
+ this.stateService.refresh$,
1696
+ ]).pipe(tap(() => this.setFields()), switchMap(([currentPage, types]) => { var _a; return this.connectorManagementService.getConnectorInstancesByType((_a = types.find(type => type.name.toLowerCase().includes('objectsapi'))) === null || _a === void 0 ? void 0 : _a.id, { page: currentPage.page, size: currentPage.size }); }), tap(instanceRes => {
1697
+ this.pageSizes$.pipe(take(1)).subscribe(sizes => {
1698
+ this.pageSizes$.next(Object.assign(Object.assign({}, sizes), { collectionSize: instanceRes.totalElements }));
1699
+ });
1700
+ }), map(res => res.content), tap(() => this.loading$.next(false)));
1701
+ this.noObjectsApiConnectors$ = this.connectorInstances$.pipe(map(instances => !instances || instances.length === 0));
1702
+ this.disabled$ = this.stateService.inputDisabled$;
1703
+ }
1704
+ ngAfterViewInit() {
1705
+ this.showSubscription = this.stateService.showExtensionModal$.subscribe(show => {
1706
+ if (show) {
1707
+ this.show();
1708
+ }
1709
+ else {
1710
+ this.hide();
1711
+ }
1712
+ });
1713
+ }
1714
+ ngOnDestroy() {
1715
+ var _a;
1716
+ (_a = this.showSubscription) === null || _a === void 0 ? void 0 : _a.unsubscribe();
1717
+ }
1718
+ paginationClicked(newPageNumber) {
1719
+ this.currentPageAndSize$.pipe(take(1)).subscribe(currentPage => {
1720
+ this.currentPageAndSize$.next(Object.assign(Object.assign({}, currentPage), { page: newPageNumber - 1 }));
1721
+ });
1722
+ }
1723
+ paginationSet(newPageSize) {
1724
+ if (newPageSize) {
1725
+ this.currentPageAndSize$.pipe(take(1)).subscribe(currentPage => {
1726
+ this.currentPageAndSize$.next(Object.assign(Object.assign({}, currentPage), { size: newPageSize }));
1727
+ });
1728
+ }
1729
+ }
1730
+ rowClicked(instance) {
1731
+ var _a, _b;
1732
+ const connectorInstanceId = instance.id;
1733
+ const enabled = true;
1734
+ const documentDefinitionName = this.route.snapshot.paramMap.get('name');
1735
+ const objectTypeUrl = (_b = (_a = instance.properties) === null || _a === void 0 ? void 0 : _a.objectType) === null || _b === void 0 ? void 0 : _b.url;
1736
+ const splitObjectTypeUrl = objectTypeUrl === null || objectTypeUrl === void 0 ? void 0 : objectTypeUrl.split('/');
1737
+ const objectTypeId = splitObjectTypeUrl[splitObjectTypeUrl.length - 1];
1738
+ this.stateService.disableInput();
1739
+ this.objectApiSyncService
1740
+ .createObjectSyncConfig({ connectorInstanceId, enabled, documentDefinitionName, objectTypeId })
1741
+ .subscribe(res => {
1742
+ this.alertService.success(this.translateService.instant('connectorManagement.extension.addSyncSuccess'));
1743
+ this.stateService.hideExtensionModal();
1744
+ this.stateService.enableInput();
1745
+ this.stateService.refresh();
1746
+ this.stateService.setLastConfigIdAdded(res.objectSyncConfig.id);
1747
+ }, () => {
1748
+ this.stateService.enableInput();
1749
+ });
1750
+ }
1751
+ setFields() {
1752
+ const getTranslatedLabel = (key) => this.translateService.instant(`connectorManagement.labels.${key}`);
1753
+ const keys = ['name'];
1754
+ this.fields$.next(keys.map(key => ({ label: getTranslatedLabel(key), key })));
1755
+ }
1756
+ show() {
1757
+ this.modal.show();
1758
+ }
1759
+ hide() {
1760
+ this.modal.hide();
1761
+ }
1762
+ }
1763
+ 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 });
1764
+ 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 } });
1765
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.9", ngImport: i0, type: ConnectorLinkExtensionModalComponent, decorators: [{
1766
+ type: Component,
1767
+ 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"] }]
1768
+ }], ctorParameters: function () { return [{ type: ConnectorManagementService }, { type: i2$1.TranslateService }, { type: ConnectorManagementStateService }, { type: ObjectApiSyncService }, { type: i5.ActivatedRoute }, { type: i6$1.AlertService }]; }, propDecorators: { modal: [{
1769
+ type: ViewChild,
1770
+ args: ['modal']
1771
+ }] } });
1772
+
1773
+ /*
1774
+ * Copyright 2015-2020 Ritense BV, the Netherlands.
1775
+ *
1776
+ * Licensed under EUPL, Version 1.2 (the "License");
1777
+ * you may not use this file except in compliance with the License.
1778
+ * You may obtain a copy of the License at
1779
+ *
1780
+ * https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12
1781
+ *
1782
+ * Unless required by applicable law or agreed to in writing, software
1783
+ * distributed under the License is distributed on an "AS IS" basis,
1784
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1785
+ * See the License for the specific language governing permissions and
1786
+ * limitations under the License.
1787
+ */
1788
+ class ConnectorLinkExtensionComponent {
1789
+ constructor(stateService, objectApiSyncService, translateService, route, alertService, connectorManagementService) {
1790
+ this.stateService = stateService;
1791
+ this.objectApiSyncService = objectApiSyncService;
1792
+ this.translateService = translateService;
1793
+ this.route = route;
1794
+ this.alertService = alertService;
1795
+ this.connectorManagementService = connectorManagementService;
1796
+ this.loading$ = new BehaviorSubject(true);
1797
+ this.objectApiSyncConfig$ = combineLatest([
1798
+ this.route.params,
1799
+ this.translateService.stream('key'),
1800
+ this.stateService.refresh$,
1801
+ ]).pipe(switchMap(([params]) => this.objectApiSyncService.getObjectSyncConfigs(params.name)), switchMap(configs => combineLatest([
1802
+ of(configs),
1803
+ ...configs.map(config => this.connectorManagementService
1804
+ .getConnectorInstanceById(config.connectorInstanceId)
1805
+ .pipe(catchError(() => of('')))),
1806
+ ])), map(results => {
1807
+ const [, ...instances] = results.filter(result => result);
1808
+ return results[0].map(syncConfig => {
1809
+ var _a;
1810
+ return (Object.assign(Object.assign({}, syncConfig), { title: ((_a = instances.find(instance => instance.id === syncConfig.connectorInstanceId)) === null || _a === void 0 ? void 0 : _a.name) ||
1811
+ 'Objects API' }));
1812
+ });
1813
+ }), map(results => (Array.isArray(results) && results.length > 0 ? results[0] : null)), tap(() => {
1814
+ this.loading$.next(false);
1815
+ }));
1816
+ this.disabled$ = this.stateService.inputDisabled$;
1817
+ }
1818
+ ngOnDestroy() {
1819
+ this.stateService.hideExtensionModal();
1820
+ }
1821
+ openModal() {
1822
+ this.stateService.showExtensionModal();
1823
+ }
1824
+ toggleSync(config) {
1825
+ this.stateService.disableInput();
1826
+ this.objectApiSyncService
1827
+ .modifyObjectSyncConfig(Object.assign(Object.assign({}, config), { enabled: !config.enabled }))
1828
+ .subscribe(() => {
1829
+ if (!config.enabled) {
1830
+ this.alertService.success(this.translateService.instant('connectorManagement.extension.addSyncSuccess'));
1831
+ }
1832
+ else {
1833
+ this.alertService.success(this.translateService.instant('connectorManagement.extension.disableSyncSuccess'));
1834
+ }
1835
+ this.stateService.enableInput();
1836
+ this.stateService.refresh();
1837
+ }, () => {
1838
+ this.stateService.enableInput();
1839
+ });
1840
+ }
1841
+ deleteSync(configId) {
1842
+ this.stateService.disableInput();
1843
+ this.objectApiSyncService.deleteObjectSyncConfig(configId).subscribe(() => {
1844
+ this.alertService.success(this.translateService.instant('connectorManagement.extension.deleteSyncSuccess'));
1845
+ this.stateService.enableInput();
1846
+ this.stateService.refresh();
1847
+ }, () => {
1848
+ this.stateService.enableInput();
1849
+ });
1850
+ }
1851
+ }
1852
+ 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 });
1853
+ 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 } });
1854
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.9", ngImport: i0, type: ConnectorLinkExtensionComponent, decorators: [{
1855
+ type: Component,
1856
+ 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"] }]
1857
+ }], ctorParameters: function () { return [{ type: ConnectorManagementStateService }, { type: ObjectApiSyncService }, { type: i2$1.TranslateService }, { type: i5.ActivatedRoute }, { type: i6$1.AlertService }, { type: ConnectorManagementService }]; } });
1858
+
1859
+ /*
1860
+ * Copyright 2015-2020 Ritense BV, the Netherlands.
1861
+ *
1862
+ * Licensed under EUPL, Version 1.2 (the "License");
1863
+ * you may not use this file except in compliance with the License.
1864
+ * You may obtain a copy of the License at
1865
+ *
1866
+ * https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12
1867
+ *
1868
+ * Unless required by applicable law or agreed to in writing, software
1869
+ * distributed under the License is distributed on an "AS IS" basis,
1870
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1871
+ * See the License for the specific language governing permissions and
1872
+ * limitations under the License.
1873
+ */
1874
+ class ConnectorManagementModule {
1875
+ }
1876
+ ConnectorManagementModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.9", ngImport: i0, type: ConnectorManagementModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
1877
+ ConnectorManagementModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "12.0.0", version: "13.3.9", ngImport: i0, type: ConnectorManagementModule, declarations: [ConnectorManagementComponent,
1878
+ AddConnectorSelectComponent,
1879
+ AddConnectorConfigureComponent,
1880
+ ConnectorModalComponent,
1881
+ ModifyConnectorComponent,
1882
+ EditConnectorPropertiesComponent,
1883
+ MultiValueConnectorPropertyComponent,
1884
+ ConnectorLinkExtensionComponent,
1885
+ ConnectorLinkExtensionModalComponent,
1886
+ EditProductAanvragenConnectorComponent,
1887
+ EditConnectorFormComponent,
1888
+ EditTaakConnectorComponent], imports: [CommonModule,
1889
+ ConnectorManagementRoutingModule,
1890
+ TranslateModule,
1891
+ WidgetModule,
1892
+ ListModule,
1893
+ SpinnerModule,
1894
+ ModalModule,
1895
+ FormIoModule,
1896
+ ButtonModule,
1897
+ TableModule,
1898
+ ModalModule$1,
1899
+ StepperModule,
1900
+ CardModule,
1901
+ FlexLayoutModule,
1902
+ TitleModule,
1903
+ InputModule,
1904
+ PageModule,
1905
+ ParagraphModule], exports: [ConnectorManagementComponent,
1906
+ AddConnectorSelectComponent,
1907
+ AddConnectorConfigureComponent,
1908
+ ConnectorModalComponent,
1909
+ ModifyConnectorComponent,
1910
+ EditConnectorPropertiesComponent,
1911
+ MultiValueConnectorPropertyComponent,
1912
+ ConnectorLinkExtensionComponent,
1913
+ ConnectorLinkExtensionModalComponent,
1914
+ EditProductAanvragenConnectorComponent,
1915
+ EditTaakConnectorComponent] });
1916
+ ConnectorManagementModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "13.3.9", ngImport: i0, type: ConnectorManagementModule, providers: [ConnectorManagementStateService], imports: [[
1917
+ CommonModule,
1918
+ ConnectorManagementRoutingModule,
1919
+ TranslateModule,
1920
+ WidgetModule,
1921
+ ListModule,
1922
+ SpinnerModule,
1923
+ ModalModule,
1924
+ FormIoModule,
1925
+ ButtonModule,
1926
+ TableModule,
1927
+ ModalModule$1,
1928
+ StepperModule,
1929
+ CardModule,
1930
+ FlexLayoutModule,
1931
+ TitleModule,
1932
+ InputModule,
1933
+ PageModule,
1934
+ ParagraphModule,
1935
+ ]] });
1936
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.9", ngImport: i0, type: ConnectorManagementModule, decorators: [{
1937
+ type: NgModule,
1938
+ args: [{
1939
+ providers: [ConnectorManagementStateService],
1940
+ declarations: [
1941
+ ConnectorManagementComponent,
1942
+ AddConnectorSelectComponent,
1943
+ AddConnectorConfigureComponent,
1944
+ ConnectorModalComponent,
1945
+ ModifyConnectorComponent,
1946
+ EditConnectorPropertiesComponent,
1947
+ MultiValueConnectorPropertyComponent,
1948
+ ConnectorLinkExtensionComponent,
1949
+ ConnectorLinkExtensionModalComponent,
1950
+ EditProductAanvragenConnectorComponent,
1951
+ EditConnectorFormComponent,
1952
+ EditTaakConnectorComponent,
1953
+ ],
1954
+ imports: [
1955
+ CommonModule,
1956
+ ConnectorManagementRoutingModule,
1957
+ TranslateModule,
1958
+ WidgetModule,
1959
+ ListModule,
1960
+ SpinnerModule,
1961
+ ModalModule,
1962
+ FormIoModule,
1963
+ ButtonModule,
1964
+ TableModule,
1965
+ ModalModule$1,
1966
+ StepperModule,
1967
+ CardModule,
1968
+ FlexLayoutModule,
1969
+ TitleModule,
1970
+ InputModule,
1971
+ PageModule,
1972
+ ParagraphModule,
1973
+ ],
1974
+ exports: [
1975
+ ConnectorManagementComponent,
1976
+ AddConnectorSelectComponent,
1977
+ AddConnectorConfigureComponent,
1978
+ ConnectorModalComponent,
1979
+ ModifyConnectorComponent,
1980
+ EditConnectorPropertiesComponent,
1981
+ MultiValueConnectorPropertyComponent,
1982
+ ConnectorLinkExtensionComponent,
1983
+ ConnectorLinkExtensionModalComponent,
1984
+ EditProductAanvragenConnectorComponent,
1985
+ EditTaakConnectorComponent,
1986
+ ],
1987
+ }]
1988
+ }] });
1989
+
1990
+ /*
1991
+ * Copyright 2015-2020 Ritense BV, the Netherlands.
1992
+ *
1993
+ * Licensed under EUPL, Version 1.2 (the "License");
1994
+ * you may not use this file except in compliance with the License.
1995
+ * You may obtain a copy of the License at
1996
+ *
1997
+ * https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12
1998
+ *
1999
+ * Unless required by applicable law or agreed to in writing, software
2000
+ * distributed under the License is distributed on an "AS IS" basis,
2001
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
2002
+ * See the License for the specific language governing permissions and
2003
+ * limitations under the License.
2004
+ */
2005
+ function connectorLinkExtensionInitializer(injector) {
2006
+ const configService = injector.get(ConfigService);
2007
+ const logger = injector.get(NGXLogger);
2008
+ return () => new Promise((resolve, reject) => {
2009
+ try {
2010
+ logger.debug('connector link extension initializer before init');
2011
+ const extension = new Extension('ConnectorLink', new BasicExtensionPoint('dossier-management', 'dossier', 'right-panel', ConnectorLinkExtensionComponent));
2012
+ configService.addExtension(extension);
2013
+ logger.debug('connector link extension initializer after init');
2014
+ resolve();
2015
+ }
2016
+ catch (error) {
2017
+ logger.debug('connector link extension initializer error', error);
2018
+ reject(error);
2019
+ }
2020
+ });
2021
+ }
2022
+
2023
+ /*
2024
+ * Copyright 2015-2020 Ritense BV, the Netherlands.
2025
+ *
2026
+ * Licensed under EUPL, Version 1.2 (the "License");
2027
+ * you may not use this file except in compliance with the License.
2028
+ * You may obtain a copy of the License at
2029
+ *
2030
+ * https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12
2031
+ *
2032
+ * Unless required by applicable law or agreed to in writing, software
2033
+ * distributed under the License is distributed on an "AS IS" basis,
2034
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
2035
+ * See the License for the specific language governing permissions and
2036
+ * limitations under the License.
2037
+ */
2038
+
2039
+ /**
2040
+ * Generated bundle index. Do not edit.
2041
+ */
2042
+
2043
+ export { AddConnectorConfigureComponent, AddConnectorSelectComponent, ConnectorLinkExtensionComponent, ConnectorLinkExtensionModalComponent, ConnectorManagementComponent, ConnectorManagementModule, ConnectorManagementService, ConnectorManagementStateService, ConnectorModalComponent, EditConnectorPropertiesComponent, EditProductAanvragenConnectorComponent, EditTaakConnectorComponent, ModifyConnectorComponent, MultiValueConnectorPropertyComponent, ObjectApiSyncService, connectorLinkExtensionInitializer };
2044
+ //# sourceMappingURL=valtimo-connector-management.mjs.map