@valtimo/connector-management 4.15.3-next-main.14 → 4.15.3-next-main.15

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