@valtimo/connector-management 4.15.3-next-main.16 → 4.17.0

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