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