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

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