@valtimo/object-management 10.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.
Files changed (36) hide show
  1. package/README.md +24 -0
  2. package/esm2020/lib/components/object-management-detail-container/object-management-detail-container.component.mjs +62 -0
  3. package/esm2020/lib/components/object-management-detail-container/tabs/object-management-detail/object-management-detail.component.mjs +51 -0
  4. package/esm2020/lib/components/object-management-detail-container/tabs/object-management-list-tab/object-management-list-tab.component.mjs +30 -0
  5. package/esm2020/lib/components/object-management-list/object-management-list.component.mjs +63 -0
  6. package/esm2020/lib/components/object-management-modal/object-management-modal.component.mjs +141 -0
  7. package/esm2020/lib/components/object-management-upload-modal/object-management-upload-modal.component.mjs +176 -0
  8. package/esm2020/lib/models/object-management.model.mjs +2 -0
  9. package/esm2020/lib/object-management-routing.module.mjs +52 -0
  10. package/esm2020/lib/object-management.module.mjs +89 -0
  11. package/esm2020/lib/services/object-management-state.service.mjs +59 -0
  12. package/esm2020/lib/services/object-management.service.mjs +46 -0
  13. package/esm2020/lib/services/tab.enum.mjs +6 -0
  14. package/esm2020/lib/services/tab.service.mjs +39 -0
  15. package/esm2020/public-api.mjs +22 -0
  16. package/esm2020/valtimo-object-management.mjs +5 -0
  17. package/fesm2015/valtimo-object-management.mjs +771 -0
  18. package/fesm2015/valtimo-object-management.mjs.map +1 -0
  19. package/fesm2020/valtimo-object-management.mjs +764 -0
  20. package/fesm2020/valtimo-object-management.mjs.map +1 -0
  21. package/index.d.ts +5 -0
  22. package/lib/components/object-management-detail-container/object-management-detail-container.component.d.ts +29 -0
  23. package/lib/components/object-management-detail-container/tabs/object-management-detail/object-management-detail.component.d.ts +15 -0
  24. package/lib/components/object-management-detail-container/tabs/object-management-list-tab/object-management-list-tab.component.d.ts +9 -0
  25. package/lib/components/object-management-list/object-management-list.component.d.ts +26 -0
  26. package/lib/components/object-management-modal/object-management-modal.component.d.ts +47 -0
  27. package/lib/components/object-management-upload-modal/object-management-upload-modal.component.d.ts +52 -0
  28. package/lib/models/object-management.model.d.ts +12 -0
  29. package/lib/object-management-routing.module.d.ts +8 -0
  30. package/lib/object-management.module.d.ts +17 -0
  31. package/lib/services/object-management-state.service.d.ts +19 -0
  32. package/lib/services/object-management.service.d.ts +16 -0
  33. package/lib/services/tab.enum.d.ts +4 -0
  34. package/lib/services/tab.service.d.ts +10 -0
  35. package/package.json +31 -0
  36. package/public-api.d.ts +3 -0
@@ -0,0 +1,771 @@
1
+ import * as i0 from '@angular/core';
2
+ import { Injectable, Component, ViewChild, Input, NgModule } from '@angular/core';
3
+ import * as i1 from '@angular/common/http';
4
+ import * as i2 from '@valtimo/config';
5
+ import { ROLE_ADMIN } from '@valtimo/config';
6
+ import * as i3$1 from '@angular/router';
7
+ import { RouterModule } from '@angular/router';
8
+ import * as i6 from '@angular/common';
9
+ import { CommonModule } from '@angular/common';
10
+ import { AuthGuardService } from '@valtimo/security';
11
+ import { Subject, BehaviorSubject, map, combineLatest, filter, switchMap } from 'rxjs';
12
+ import * as i6$2 from '@valtimo/components';
13
+ import { DropzoneModule, WidgetModule, ListModule } from '@valtimo/components';
14
+ import { take, tap, switchMap as switchMap$1 } from 'rxjs/operators';
15
+ import * as i3 from '@valtimo/form-management';
16
+ import * as i4 from '@valtimo/plugin';
17
+ import * as i5 from '@valtimo/user-interface';
18
+ import { ModalModule, TitleModule, ButtonModule, FormModule, InputModule, SelectModule } from '@valtimo/user-interface';
19
+ import * as i6$1 from '@ngx-translate/core';
20
+ import { TranslateModule } from '@ngx-translate/core';
21
+
22
+ /*
23
+ * Copyright 2015-2020 Ritense BV, the Netherlands.
24
+ *
25
+ * Licensed under EUPL, Version 1.2 (the "License");
26
+ * you may not use this file except in compliance with the License.
27
+ * You may obtain a copy of the License at
28
+ *
29
+ * https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12
30
+ *
31
+ * Unless required by applicable law or agreed to in writing, software
32
+ * distributed under the License is distributed on an "AS IS" basis,
33
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
34
+ * See the License for the specific language governing permissions and
35
+ * limitations under the License.
36
+ */
37
+ class ObjectManagementService {
38
+ constructor(http, configService) {
39
+ this.http = http;
40
+ this.valtimoEndpointUri = configService.config.valtimoApi.endpointUri;
41
+ }
42
+ getAllObjects() {
43
+ return this.http.get(`${this.valtimoEndpointUri}v1/object/management/configuration`);
44
+ }
45
+ getObjectById(id) {
46
+ return this.http.get(`${this.valtimoEndpointUri}v1/object/management/configuration/${id}`);
47
+ }
48
+ createObject(payload) {
49
+ return this.http.post(`${this.valtimoEndpointUri}v1/object/management/configuration`, payload);
50
+ }
51
+ editObject(payload) {
52
+ return this.http.put(`${this.valtimoEndpointUri}v1/object/management/configuration`, payload);
53
+ }
54
+ }
55
+ ObjectManagementService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.2.12", ngImport: i0, type: ObjectManagementService, deps: [{ token: i1.HttpClient }, { token: i2.ConfigService }], target: i0.ɵɵFactoryTarget.Injectable });
56
+ ObjectManagementService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "14.2.12", ngImport: i0, type: ObjectManagementService, providedIn: 'root' });
57
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.2.12", ngImport: i0, type: ObjectManagementService, decorators: [{
58
+ type: Injectable,
59
+ args: [{
60
+ providedIn: 'root'
61
+ }]
62
+ }], ctorParameters: function () { return [{ type: i1.HttpClient }, { type: i2.ConfigService }]; } });
63
+
64
+ var TabEnum;
65
+ (function (TabEnum) {
66
+ TabEnum["GENERAL"] = "general";
67
+ TabEnum["LIST"] = "list";
68
+ })(TabEnum || (TabEnum = {}));
69
+
70
+ /*
71
+ * Copyright 2015-2020 Ritense BV, the Netherlands.
72
+ *
73
+ * Licensed under EUPL, Version 1.2 (the "License");
74
+ * you may not use this file except in compliance with the License.
75
+ * You may obtain a copy of the License at
76
+ *
77
+ * https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12
78
+ *
79
+ * Unless required by applicable law or agreed to in writing, software
80
+ * distributed under the License is distributed on an "AS IS" basis,
81
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
82
+ * See the License for the specific language governing permissions and
83
+ * limitations under the License.
84
+ */
85
+ class ObjectManagementStateService {
86
+ constructor() {
87
+ this._showModal$ = new Subject();
88
+ this._hideModal$ = new Subject();
89
+ this._refresh$ = new BehaviorSubject(null);
90
+ this._modalType$ = new BehaviorSubject('add');
91
+ }
92
+ get showModal$() {
93
+ return this._showModal$.asObservable();
94
+ }
95
+ get hideModal$() {
96
+ return this._hideModal$.asObservable();
97
+ }
98
+ get refresh$() {
99
+ return this._refresh$.asObservable();
100
+ }
101
+ get modalType$() {
102
+ return this._modalType$.asObservable();
103
+ }
104
+ showModal() {
105
+ this._showModal$.next(null);
106
+ }
107
+ hideModal() {
108
+ this._hideModal$.next(null);
109
+ }
110
+ refresh() {
111
+ this._refresh$.next(null);
112
+ }
113
+ setModalType(type) {
114
+ this._modalType$.next(type);
115
+ }
116
+ }
117
+ ObjectManagementStateService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.2.12", ngImport: i0, type: ObjectManagementStateService, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
118
+ ObjectManagementStateService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "14.2.12", ngImport: i0, type: ObjectManagementStateService, providedIn: 'root' });
119
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.2.12", ngImport: i0, type: ObjectManagementStateService, decorators: [{
120
+ type: Injectable,
121
+ args: [{
122
+ providedIn: 'root',
123
+ }]
124
+ }], ctorParameters: function () { return []; } });
125
+
126
+ /*
127
+ * Copyright 2015-2020 Ritense BV, the Netherlands.
128
+ *
129
+ * Licensed under EUPL, Version 1.2 (the "License");
130
+ * you may not use this file except in compliance with the License.
131
+ * You may obtain a copy of the License at
132
+ *
133
+ * https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12
134
+ *
135
+ * Unless required by applicable law or agreed to in writing, software
136
+ * distributed under the License is distributed on an "AS IS" basis,
137
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
138
+ * See the License for the specific language governing permissions and
139
+ * limitations under the License.
140
+ */
141
+ class TabService {
142
+ constructor() {
143
+ this._currentTab$ = new BehaviorSubject(TabEnum.GENERAL);
144
+ }
145
+ get currentTab$() {
146
+ return this._currentTab$.asObservable();
147
+ }
148
+ set currentTab(tab) {
149
+ this._currentTab$.next(tab);
150
+ }
151
+ }
152
+ TabService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.2.12", ngImport: i0, type: TabService, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
153
+ TabService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "14.2.12", ngImport: i0, type: TabService, providedIn: 'root' });
154
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.2.12", ngImport: i0, type: TabService, decorators: [{
155
+ type: Injectable,
156
+ args: [{
157
+ providedIn: 'root',
158
+ }]
159
+ }] });
160
+
161
+ /*
162
+ * Copyright 2015-2020 Ritense BV, the Netherlands.
163
+ *
164
+ * Licensed under EUPL, Version 1.2 (the "License");
165
+ * you may not use this file except in compliance with the License.
166
+ * You may obtain a copy of the License at
167
+ *
168
+ * https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12
169
+ *
170
+ * Unless required by applicable law or agreed to in writing, software
171
+ * distributed under the License is distributed on an "AS IS" basis,
172
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
173
+ * See the License for the specific language governing permissions and
174
+ * limitations under the License.
175
+ */
176
+ class ObjectManagementModalComponent {
177
+ constructor(objectManagementState, objectManagementService, formManagementService, pluginManagementService, modalService) {
178
+ this.objectManagementState = objectManagementState;
179
+ this.objectManagementService = objectManagementService;
180
+ this.formManagementService = formManagementService;
181
+ this.pluginManagementService = pluginManagementService;
182
+ this.modalService = modalService;
183
+ this.valid$ = new BehaviorSubject(false);
184
+ this.showForm$ = this.modalService.modalVisible$;
185
+ this.modalType$ = this.objectManagementState.modalType$;
186
+ this.formData$ = new BehaviorSubject(null);
187
+ this.selectedObjecttype$ = new BehaviorSubject(null);
188
+ this.formDefinitions$ = this.formManagementService.queryFormDefinitions().pipe(map((results) => {
189
+ var _a;
190
+ return (_a = results === null || results === void 0 ? void 0 : results.body) === null || _a === void 0 ? void 0 : _a.content.map(configuration => ({
191
+ id: configuration.id,
192
+ text: configuration.name
193
+ }));
194
+ }));
195
+ this.configurationInstances$ = this.pluginManagementService.getAllPluginConfigurations().pipe(map((configurations) => configurations));
196
+ this.objectsApiConfigurations$ = this.configurationInstances$.pipe(map((configurations) => {
197
+ const filteredObjectsApiConfigurations = configurations.filter(configuration => { var _a; return ((_a = configuration === null || configuration === void 0 ? void 0 : configuration.pluginDefinition) === null || _a === void 0 ? void 0 : _a.key) === 'objectenapi'; });
198
+ return filteredObjectsApiConfigurations.map(configuration => ({
199
+ id: configuration.id,
200
+ text: configuration.title,
201
+ }));
202
+ }));
203
+ this.objecttypesApiConfigurations$ = this.configurationInstances$.pipe(map((configurations) => {
204
+ const filteredObjecttypesApiConfigurations = configurations.filter(configuration => { var _a; return ((_a = configuration === null || configuration === void 0 ? void 0 : configuration.pluginDefinition) === null || _a === void 0 ? void 0 : _a.key) === 'objecttypenapi'; });
205
+ return filteredObjecttypesApiConfigurations.map(configuration => ({
206
+ id: configuration.id,
207
+ text: configuration.title,
208
+ properties: configuration.properties
209
+ }));
210
+ }));
211
+ }
212
+ ngAfterViewInit() {
213
+ this.openShowSubscription();
214
+ this.openHideSubscription();
215
+ }
216
+ ngOnDestroy() {
217
+ var _a, _b;
218
+ (_a = this.showSubscription) === null || _a === void 0 ? void 0 : _a.unsubscribe();
219
+ (_b = this.hideSubscription) === null || _b === void 0 ? void 0 : _b.unsubscribe();
220
+ }
221
+ hide() {
222
+ this.formData$.next(null);
223
+ this.valid$.next(false);
224
+ this.modalService.closeModal();
225
+ }
226
+ cancel() {
227
+ this.hide();
228
+ }
229
+ save() {
230
+ combineLatest([this.valid$, this.formData$, this.modalType$])
231
+ .pipe(take(1))
232
+ .subscribe(([valid, formData, modalType]) => {
233
+ if (valid) {
234
+ if (modalType === 'add') {
235
+ this.objectManagementService.createObject(Object.assign({}, formData)).subscribe(() => {
236
+ this.objectManagementState.refresh();
237
+ this.objectManagementState.hideModal();
238
+ });
239
+ }
240
+ else if (modalType === 'edit') {
241
+ this.objectManagementService.editObject(Object.assign({}, formData)).subscribe(() => {
242
+ this.objectManagementState.refresh();
243
+ this.objectManagementState.hideModal();
244
+ });
245
+ }
246
+ }
247
+ });
248
+ }
249
+ openShowSubscription() {
250
+ this.showSubscription = this.objectManagementState.showModal$.subscribe(() => {
251
+ this.show();
252
+ });
253
+ }
254
+ openHideSubscription() {
255
+ this.hideSubscription = this.objectManagementState.hideModal$.subscribe(() => {
256
+ this.hide();
257
+ });
258
+ }
259
+ show() {
260
+ this.objectManagementState.modalType$.pipe(take(1)).subscribe(modalType => {
261
+ if (modalType === 'edit' || modalType === 'add') {
262
+ this.modalService.openModal(this.objectManagementModal);
263
+ }
264
+ });
265
+ }
266
+ formValueChange(data) {
267
+ if (data.showInDataMenu === '') {
268
+ data.showInDataMenu = false;
269
+ }
270
+ this.formData$.next(data);
271
+ this.setValid(data);
272
+ }
273
+ setValid(data) {
274
+ this.valid$.next(!!(data.title &&
275
+ data.objectenApiPluginConfigurationId &&
276
+ data.objecttypenApiPluginConfigurationId &&
277
+ data.objecttypeId));
278
+ }
279
+ selectObjectType(objecttype) {
280
+ this.selectedObjecttype$.next(objecttype);
281
+ }
282
+ }
283
+ ObjectManagementModalComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.2.12", ngImport: i0, type: ObjectManagementModalComponent, deps: [{ token: ObjectManagementStateService }, { token: ObjectManagementService }, { token: i3.FormManagementService }, { token: i4.PluginManagementService }, { token: i5.ModalService }], target: i0.ɵɵFactoryTarget.Component });
284
+ ObjectManagementModalComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "14.2.12", type: ObjectManagementModalComponent, selector: "valtimo-object-management-modal", inputs: { prefillObject$: "prefillObject$" }, viewQueries: [{ propertyName: "objectManagementModal", first: true, predicate: ["objectManagementModal"], descendants: true }], ngImport: i0, template: "<!--\n ~ Copyright 2015-2020 Ritense BV, the Netherlands.\n ~\n ~ Licensed under EUPL, Version 1.2 (the \"License\");\n ~ you may not use this file except in compliance with the License.\n ~ You may obtain a copy of the License at\n ~\n ~ https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12\n ~\n ~ Unless required by applicable law or agreed to in writing, software\n ~ distributed under the License is distributed on an \"AS IS\" basis,\n ~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n ~ See the License for the specific language governing permissions and\n ~ limitations under the License.\n -->\n\n<v-modal #objectManagementModal *ngIf=\"{\n disabled: disabled$ | async,\n valid: valid$ | async,\n modalType: modalType$ | async,\n prefillObject: prefillObject$ | async\n } as obs\">\n <div role=\"header\">\n <div class=\"add-title\">\n <v-title [margin]=\"false\">{{ (obs.modalType === 'add' ? 'objectManagement.createObjecttype' : 'objectManagement.editObjecttype') | translate }}</v-title>\n </div>\n </div>\n <div role=\"content\">\n <ng-container *ngTemplateOutlet=\"form; context: {prefillObject: obs.prefillObject, modalType: obs.modalType}\"></ng-container>\n </div>\n <div role=\"footer\">\n <div class=\"buttons\">\n <v-button (clickEvent)=\"cancel()\" [disabled]=\"obs.disabled\" type=\"secondary\">\n {{ 'objectManagement.cancel' | translate }}\n </v-button>\n <v-button (clickEvent)=\"save()\" [disabled]=\"obs.disabled || !obs.valid\" mdiIcon=\"plus\" type=\"success\">\n {{ (obs.modalType === 'add' ? 'objectManagement.add' : 'objectManagement.edit') | translate }}\n </v-button>\n </div>\n </div>\n</v-modal>\n\n<ng-template #form let-prefillObject=\"prefillObject\" let-modalType=\"modalType\">\n <ng-container *ngIf=\"showForm$ | async\">\n <v-form (valueChange)=\"formValueChange($event)\">\n <v-input *ngIf=\"modalType === 'edit'\"\n hidden\n [disabled]=\"true\"\n [defaultValue]=\"prefillObject?.id\"\n name=\"id\"\n ></v-input>\n\n <v-input\n [margin]=\"true\"\n [required]=\"true\"\n [title]=\"'objectManagement.labels.title' | translate\"\n [tooltip]=\"'objectManagement.tooltips.title' | translate\"\n [widthPx]=\"350\"\n [defaultValue]=\"prefillObject?.title\"\n name=\"title\"\n ></v-input>\n\n <ng-container *ngIf=\"{\n connectionInstances: configurationInstances$ | async,\n objectsApiConfigurations: objectsApiConfigurations$ | async,\n objecttypesApiConfigurations: objecttypesApiConfigurations$ | async\n } as objectObs\"\n >\n <v-select\n [items]=\"objectObs.objectsApiConfigurations\"\n [margin]=\"true\"\n [widthInPx]=\"350\"\n name=\"objectenApiPluginConfigurationId\"\n [title]=\"'objectManagement.labels.objects' | translate\"\n [defaultSelectionId]=\"prefillObject?.objectenApiPluginConfigurationId\"\n [required]=\"true\"\n ></v-select>\n\n <v-select\n [items]=\"objectObs.objecttypesApiConfigurations\"\n [margin]=\"true\"\n [widthInPx]=\"350\"\n name=\"objecttypenApiPluginConfigurationId\"\n [title]=\"'objectManagement.labels.objecttypes' | translate\"\n [defaultSelectionId]=\"prefillObject?.objecttypenApiPluginConfigurationId\"\n [required]=\"true\"\n (selectedChange)=\"selectObjectType($event)\"\n ></v-select>\n </ng-container>\n\n <v-input\n [margin]=\"true\"\n [required]=\"true\"\n [title]=\"'objectManagement.labels.objecttypeId' | translate\"\n [tooltip]=\"'objectManagement.tooltips.objecttypeId' | translate\"\n [widthPx]=\"350\"\n [defaultValue]=\"prefillObject?.objecttypeId\"\n name=\"objecttypeId\"\n ></v-input>\n\n <ng-container *ngIf=\"{formDefinitions: formDefinitions$ | async} as formObs\">\n <v-select\n [items]=\"formObs.formDefinitions\"\n [margin]=\"true\"\n [widthInPx]=\"350\"\n name=\"formDefinitionView\"\n [title]=\"'objectManagement.labels.formDefinitionView' | translate\"\n [tooltip]=\"'objectManagement.tooltips.formDefinitionView' | translate\"\n [defaultSelectionId]=\"prefillObject?.formDefinitionView\"\n ></v-select>\n\n <v-select\n [items]=\"formObs.formDefinitions\"\n [margin]=\"true\"\n [widthInPx]=\"350\"\n name=\"formDefinitionEdit\"\n [title]=\"'objectManagement.labels.formDefinitionEdit' | translate\"\n [tooltip]=\"'objectManagement.tooltips.formDefinitionEdit' | translate\"\n [defaultSelectionId]=\"prefillObject?.formDefinitionEdit\"\n ></v-select>\n </ng-container>\n\n <v-input\n [margin]=\"true\"\n type=\"checkbox\"\n [title]=\"'objectManagement.labels.showInDataMenu' | translate\"\n [tooltip]=\"'objectManagement.tooltips.showInDataMenu' | translate\"\n name=\"showInDataMenu\"\n [defaultValue]=\"prefillObject?.showInDataMenu\"\n ></v-input>\n </v-form>\n </ng-container>\n</ng-template>\n", styles: ["/*!\n * Copyright 2015-2020 Ritense BV, the Netherlands.\n *\n * Licensed under EUPL, Version 1.2 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" basis,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */.buttons{width:100%;display:flex;flex-direction:row;justify-content:space-between}\n"], dependencies: [{ kind: "directive", type: i6.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: i6.NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }, { kind: "component", type: i5.ModalComponent, selector: "v-modal", inputs: ["appearingDelayMs", "maxWidthPx", "hideFooter"], outputs: ["closeEvent"] }, { kind: "component", type: i5.TitleComponent, selector: "v-title", inputs: ["type", "margin", "fullWidth", "center"] }, { kind: "component", type: i5.ButtonComponent, selector: "v-button", inputs: ["type", "mdiIcon", "disabled", "title", "titleTranslationKey"], outputs: ["clickEvent"] }, { kind: "component", type: i5.FormComponent, selector: "v-form", inputs: ["className"], outputs: ["valueChange"] }, { kind: "component", type: i5.InputComponent, selector: "v-input", inputs: ["name", "type", "title", "titleTranslationKey", "defaultValue", "widthPx", "fullWidth", "margin", "disabled", "step", "min", "maxLength", "tooltip", "required", "hideNumberSpinBox", "smallLabel", "rows", "clear$"], outputs: ["valueChange"] }, { kind: "component", type: i5.SelectComponent, selector: "v-select", inputs: ["items", "defaultSelection", "defaultSelectionId", "clearable", "disabled", "multiple", "margin", "widthInPx", "notFoundText", "clearAllText", "name", "title", "titleTranslationKey", "clearSelectionSubject$", "tooltip", "required", "loading", "loadingText", "placeholder"], outputs: ["selectedChange", "clear"] }, { kind: "pipe", type: i6.AsyncPipe, name: "async" }, { kind: "pipe", type: i6$1.TranslatePipe, name: "translate" }] });
285
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.2.12", ngImport: i0, type: ObjectManagementModalComponent, decorators: [{
286
+ type: Component,
287
+ args: [{ selector: 'valtimo-object-management-modal', template: "<!--\n ~ Copyright 2015-2020 Ritense BV, the Netherlands.\n ~\n ~ Licensed under EUPL, Version 1.2 (the \"License\");\n ~ you may not use this file except in compliance with the License.\n ~ You may obtain a copy of the License at\n ~\n ~ https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12\n ~\n ~ Unless required by applicable law or agreed to in writing, software\n ~ distributed under the License is distributed on an \"AS IS\" basis,\n ~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n ~ See the License for the specific language governing permissions and\n ~ limitations under the License.\n -->\n\n<v-modal #objectManagementModal *ngIf=\"{\n disabled: disabled$ | async,\n valid: valid$ | async,\n modalType: modalType$ | async,\n prefillObject: prefillObject$ | async\n } as obs\">\n <div role=\"header\">\n <div class=\"add-title\">\n <v-title [margin]=\"false\">{{ (obs.modalType === 'add' ? 'objectManagement.createObjecttype' : 'objectManagement.editObjecttype') | translate }}</v-title>\n </div>\n </div>\n <div role=\"content\">\n <ng-container *ngTemplateOutlet=\"form; context: {prefillObject: obs.prefillObject, modalType: obs.modalType}\"></ng-container>\n </div>\n <div role=\"footer\">\n <div class=\"buttons\">\n <v-button (clickEvent)=\"cancel()\" [disabled]=\"obs.disabled\" type=\"secondary\">\n {{ 'objectManagement.cancel' | translate }}\n </v-button>\n <v-button (clickEvent)=\"save()\" [disabled]=\"obs.disabled || !obs.valid\" mdiIcon=\"plus\" type=\"success\">\n {{ (obs.modalType === 'add' ? 'objectManagement.add' : 'objectManagement.edit') | translate }}\n </v-button>\n </div>\n </div>\n</v-modal>\n\n<ng-template #form let-prefillObject=\"prefillObject\" let-modalType=\"modalType\">\n <ng-container *ngIf=\"showForm$ | async\">\n <v-form (valueChange)=\"formValueChange($event)\">\n <v-input *ngIf=\"modalType === 'edit'\"\n hidden\n [disabled]=\"true\"\n [defaultValue]=\"prefillObject?.id\"\n name=\"id\"\n ></v-input>\n\n <v-input\n [margin]=\"true\"\n [required]=\"true\"\n [title]=\"'objectManagement.labels.title' | translate\"\n [tooltip]=\"'objectManagement.tooltips.title' | translate\"\n [widthPx]=\"350\"\n [defaultValue]=\"prefillObject?.title\"\n name=\"title\"\n ></v-input>\n\n <ng-container *ngIf=\"{\n connectionInstances: configurationInstances$ | async,\n objectsApiConfigurations: objectsApiConfigurations$ | async,\n objecttypesApiConfigurations: objecttypesApiConfigurations$ | async\n } as objectObs\"\n >\n <v-select\n [items]=\"objectObs.objectsApiConfigurations\"\n [margin]=\"true\"\n [widthInPx]=\"350\"\n name=\"objectenApiPluginConfigurationId\"\n [title]=\"'objectManagement.labels.objects' | translate\"\n [defaultSelectionId]=\"prefillObject?.objectenApiPluginConfigurationId\"\n [required]=\"true\"\n ></v-select>\n\n <v-select\n [items]=\"objectObs.objecttypesApiConfigurations\"\n [margin]=\"true\"\n [widthInPx]=\"350\"\n name=\"objecttypenApiPluginConfigurationId\"\n [title]=\"'objectManagement.labels.objecttypes' | translate\"\n [defaultSelectionId]=\"prefillObject?.objecttypenApiPluginConfigurationId\"\n [required]=\"true\"\n (selectedChange)=\"selectObjectType($event)\"\n ></v-select>\n </ng-container>\n\n <v-input\n [margin]=\"true\"\n [required]=\"true\"\n [title]=\"'objectManagement.labels.objecttypeId' | translate\"\n [tooltip]=\"'objectManagement.tooltips.objecttypeId' | translate\"\n [widthPx]=\"350\"\n [defaultValue]=\"prefillObject?.objecttypeId\"\n name=\"objecttypeId\"\n ></v-input>\n\n <ng-container *ngIf=\"{formDefinitions: formDefinitions$ | async} as formObs\">\n <v-select\n [items]=\"formObs.formDefinitions\"\n [margin]=\"true\"\n [widthInPx]=\"350\"\n name=\"formDefinitionView\"\n [title]=\"'objectManagement.labels.formDefinitionView' | translate\"\n [tooltip]=\"'objectManagement.tooltips.formDefinitionView' | translate\"\n [defaultSelectionId]=\"prefillObject?.formDefinitionView\"\n ></v-select>\n\n <v-select\n [items]=\"formObs.formDefinitions\"\n [margin]=\"true\"\n [widthInPx]=\"350\"\n name=\"formDefinitionEdit\"\n [title]=\"'objectManagement.labels.formDefinitionEdit' | translate\"\n [tooltip]=\"'objectManagement.tooltips.formDefinitionEdit' | translate\"\n [defaultSelectionId]=\"prefillObject?.formDefinitionEdit\"\n ></v-select>\n </ng-container>\n\n <v-input\n [margin]=\"true\"\n type=\"checkbox\"\n [title]=\"'objectManagement.labels.showInDataMenu' | translate\"\n [tooltip]=\"'objectManagement.tooltips.showInDataMenu' | translate\"\n name=\"showInDataMenu\"\n [defaultValue]=\"prefillObject?.showInDataMenu\"\n ></v-input>\n </v-form>\n </ng-container>\n</ng-template>\n", styles: ["/*!\n * Copyright 2015-2020 Ritense BV, the Netherlands.\n *\n * Licensed under EUPL, Version 1.2 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" basis,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */.buttons{width:100%;display:flex;flex-direction:row;justify-content:space-between}\n"] }]
288
+ }], ctorParameters: function () { return [{ type: ObjectManagementStateService }, { type: ObjectManagementService }, { type: i3.FormManagementService }, { type: i4.PluginManagementService }, { type: i5.ModalService }]; }, propDecorators: { objectManagementModal: [{
289
+ type: ViewChild,
290
+ args: ['objectManagementModal']
291
+ }], prefillObject$: [{
292
+ type: Input
293
+ }] } });
294
+
295
+ /*
296
+ * Copyright 2015-2020 Ritense BV, the Netherlands.
297
+ *
298
+ * Licensed under EUPL, Version 1.2 (the "License");
299
+ * you may not use this file except in compliance with the License.
300
+ * You may obtain a copy of the License at
301
+ *
302
+ * https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12
303
+ *
304
+ * Unless required by applicable law or agreed to in writing, software
305
+ * distributed under the License is distributed on an "AS IS" basis,
306
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
307
+ * See the License for the specific language governing permissions and
308
+ * limitations under the License.
309
+ */
310
+ class ObjectManagementDetailComponent {
311
+ constructor(objectManagementService, objectManagementState) {
312
+ this.objectManagementService = objectManagementService;
313
+ this.objectManagementState = objectManagementState;
314
+ }
315
+ downloadDefinition(object) {
316
+ const dataString = 'data:text/json;charset=utf-8,' +
317
+ encodeURIComponent(JSON.stringify(object, null, 2));
318
+ console.log(dataString);
319
+ const downloadAnchorElement = document.getElementById('downloadAnchorElement');
320
+ downloadAnchorElement.setAttribute('href', dataString);
321
+ downloadAnchorElement.setAttribute('download', `${object.id}.json`);
322
+ downloadAnchorElement.click();
323
+ }
324
+ showEditModal() {
325
+ this.objectManagementState.setModalType('edit');
326
+ this.objectManagementState.showModal();
327
+ }
328
+ }
329
+ ObjectManagementDetailComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.2.12", ngImport: i0, type: ObjectManagementDetailComponent, deps: [{ token: ObjectManagementService }, { token: ObjectManagementStateService }], target: i0.ɵɵFactoryTarget.Component });
330
+ ObjectManagementDetailComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "14.2.12", type: ObjectManagementDetailComponent, selector: "valtimo-object-management-detail", inputs: { object$: "object$" }, ngImport: i0, template: "<!--\n ~ Copyright 2015-2020 Ritense BV, the Netherlands.\n ~\n ~ Licensed under EUPL, Version 1.2 (the \"License\");\n ~ you may not use this file except in compliance with the License.\n ~ You may obtain a copy of the License at\n ~\n ~ https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12\n ~\n ~ Unless required by applicable law or agreed to in writing, software\n ~ distributed under the License is distributed on an \"AS IS\" basis,\n ~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n ~ See the License for the specific language governing permissions and\n ~ limitations under the License.\n -->\n<div id=\"object-datail-content\" class=\"pt-0\" *ngIf=\"{\n object: object$ | async\n} as obs\">\n <ng-container *ngTemplateOutlet=\"buttons; context: {object: obs.object}\"></ng-container>\n <div class=\"clearfix\"></div>\n <ng-container *ngTemplateOutlet=\"widget ; context: {object: obs.object}\"></ng-container>\n</div>\n\n<ng-template #buttons let-object=\"object\">\n <div class=\"btn-group mt-m3px mb-3 pr-2 float-right\">\n <button (click)=\"downloadDefinition(object)\" class=\"btn btn-primary btn-space\">\n <i class=\"icon mdi mdi-download mr-1\"></i>\n {{ 'objectManagement.download' | translate }}\n </button>\n <a id=\"downloadAnchorElement\" class=\"d-none\"></a>\n <button (click)=\"showEditModal()\" class=\"btn btn-secondary btn-space\">\n <i class=\"icon mdi mdi-pencil mr-1\"></i>\n {{ 'objectManagement.editObjecttype' | translate }}\n </button>\n </div>\n</ng-template>\n\n<ng-template #widget let-object=\"object\">\n <valtimo-widget>\n <div class=\"row bg-white mt-5 mb-2 pl-2 pr-2\">\n <div class=\"col-5 bg-red\">\n <textarea class=\"w-100 object-schema\" disabled rows=\"25\">{{ object | json }}</textarea>\n </div>\n </div>\n </valtimo-widget>\n</ng-template>\n\n<valtimo-object-management-modal [prefillObject$]=\"object$\"></valtimo-object-management-modal>\n", styles: ["/*!\n * Copyright 2015-2020 Ritense BV, the Netherlands.\n *\n * Licensed under EUPL, Version 1.2 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" basis,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */.row{margin:0}.object-schema{resize:none}valtimo-widget::ng-deep .card-border.card-full-default{border:none}\n"], dependencies: [{ kind: "directive", type: i6.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: i6.NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }, { kind: "component", type: i6$2.WidgetComponent, selector: "valtimo-widget", inputs: ["type", "name", "icon", "contrast", "divider", "title", "subtitle", "collapseAble", "collapse", "additionalClasses"] }, { kind: "component", type: ObjectManagementModalComponent, selector: "valtimo-object-management-modal", inputs: ["prefillObject$"] }, { kind: "pipe", type: i6.AsyncPipe, name: "async" }, { kind: "pipe", type: i6.JsonPipe, name: "json" }, { kind: "pipe", type: i6$1.TranslatePipe, name: "translate" }] });
331
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.2.12", ngImport: i0, type: ObjectManagementDetailComponent, decorators: [{
332
+ type: Component,
333
+ args: [{ selector: 'valtimo-object-management-detail', 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<div id=\"object-datail-content\" class=\"pt-0\" *ngIf=\"{\n object: object$ | async\n} as obs\">\n <ng-container *ngTemplateOutlet=\"buttons; context: {object: obs.object}\"></ng-container>\n <div class=\"clearfix\"></div>\n <ng-container *ngTemplateOutlet=\"widget ; context: {object: obs.object}\"></ng-container>\n</div>\n\n<ng-template #buttons let-object=\"object\">\n <div class=\"btn-group mt-m3px mb-3 pr-2 float-right\">\n <button (click)=\"downloadDefinition(object)\" class=\"btn btn-primary btn-space\">\n <i class=\"icon mdi mdi-download mr-1\"></i>\n {{ 'objectManagement.download' | translate }}\n </button>\n <a id=\"downloadAnchorElement\" class=\"d-none\"></a>\n <button (click)=\"showEditModal()\" class=\"btn btn-secondary btn-space\">\n <i class=\"icon mdi mdi-pencil mr-1\"></i>\n {{ 'objectManagement.editObjecttype' | translate }}\n </button>\n </div>\n</ng-template>\n\n<ng-template #widget let-object=\"object\">\n <valtimo-widget>\n <div class=\"row bg-white mt-5 mb-2 pl-2 pr-2\">\n <div class=\"col-5 bg-red\">\n <textarea class=\"w-100 object-schema\" disabled rows=\"25\">{{ object | json }}</textarea>\n </div>\n </div>\n </valtimo-widget>\n</ng-template>\n\n<valtimo-object-management-modal [prefillObject$]=\"object$\"></valtimo-object-management-modal>\n", styles: ["/*!\n * Copyright 2015-2020 Ritense BV, the Netherlands.\n *\n * Licensed under EUPL, Version 1.2 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" basis,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */.row{margin:0}.object-schema{resize:none}valtimo-widget::ng-deep .card-border.card-full-default{border:none}\n"] }]
334
+ }], ctorParameters: function () { return [{ type: ObjectManagementService }, { type: ObjectManagementStateService }]; }, propDecorators: { object$: [{
335
+ type: Input
336
+ }] } });
337
+
338
+ /*
339
+ * Copyright 2015-2020 Ritense BV, the Netherlands.
340
+ *
341
+ * Licensed under EUPL, Version 1.2 (the "License");
342
+ * you may not use this file except in compliance with the License.
343
+ * You may obtain a copy of the License at
344
+ *
345
+ * https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12
346
+ *
347
+ * Unless required by applicable law or agreed to in writing, software
348
+ * distributed under the License is distributed on an "AS IS" basis,
349
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
350
+ * See the License for the specific language governing permissions and
351
+ * limitations under the License.
352
+ */
353
+ class ObjectManagementListTabComponent {
354
+ constructor() { }
355
+ }
356
+ ObjectManagementListTabComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.2.12", ngImport: i0, type: ObjectManagementListTabComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
357
+ ObjectManagementListTabComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "14.2.12", type: ObjectManagementListTabComponent, selector: "valtimo-object-management-list-tab", inputs: { object$: "object$" }, ngImport: i0, template: "<!--\n ~ Copyright 2015-2020 Ritense BV, the Netherlands.\n ~\n ~ Licensed under EUPL, Version 1.2 (the \"License\");\n ~ you may not use this file except in compliance with the License.\n ~ You may obtain a copy of the License at\n ~\n ~ https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12\n ~\n ~ Unless required by applicable law or agreed to in writing, software\n ~ distributed under the License is distributed on an \"AS IS\" basis,\n ~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n ~ See the License for the specific language governing permissions and\n ~ limitations under the License.\n -->\n<div id=\"object-list-tab-content\" class=\"pt-0\">\n <ng-container *ngTemplateOutlet=\"widget\"></ng-container>\n</div>\n\n<ng-template #widget></ng-template>\n\n", styles: ["/*!\n * Copyright 2015-2020 Ritense BV, the Netherlands.\n *\n * Licensed under EUPL, Version 1.2 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" basis,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n"], dependencies: [{ kind: "directive", type: i6.NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }] });
358
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.2.12", ngImport: i0, type: ObjectManagementListTabComponent, decorators: [{
359
+ type: Component,
360
+ args: [{ selector: 'valtimo-object-management-list-tab', 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<div id=\"object-list-tab-content\" class=\"pt-0\">\n <ng-container *ngTemplateOutlet=\"widget\"></ng-container>\n</div>\n\n<ng-template #widget></ng-template>\n\n", styles: ["/*!\n * Copyright 2015-2020 Ritense BV, the Netherlands.\n *\n * Licensed under EUPL, Version 1.2 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" basis,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n"] }]
361
+ }], ctorParameters: function () { return []; }, propDecorators: { object$: [{
362
+ type: Input
363
+ }] } });
364
+
365
+ /*
366
+ * Copyright 2015-2020 Ritense BV, the Netherlands.
367
+ *
368
+ * Licensed under EUPL, Version 1.2 (the "License");
369
+ * you may not use this file except in compliance with the License.
370
+ * You may obtain a copy of the License at
371
+ *
372
+ * https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12
373
+ *
374
+ * Unless required by applicable law or agreed to in writing, software
375
+ * distributed under the License is distributed on an "AS IS" basis,
376
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
377
+ * See the License for the specific language governing permissions and
378
+ * limitations under the License.
379
+ */
380
+ class ObjectManagementDetailContainerComponent {
381
+ constructor(objectManagementState, objectManagementService, route, configService, tabService) {
382
+ this.objectManagementState = objectManagementState;
383
+ this.objectManagementService = objectManagementService;
384
+ this.route = route;
385
+ this.configService = configService;
386
+ this.tabService = tabService;
387
+ this.TabEnum = TabEnum;
388
+ this.objectId$ = this.route.params.pipe(map(params => params.id || ''), filter(id => !!id));
389
+ this.object$ = combineLatest([this.objectId$, this.objectManagementState.refresh$]).pipe(switchMap(([object]) => this.objectManagementService.getObjectById(object)));
390
+ this.caseListColumn = this.configService.config.featureToggles.caseListColumn;
391
+ }
392
+ ngOnInit() {
393
+ this.openCurrentTabSubscription();
394
+ }
395
+ displayBodyComponent(tab) {
396
+ this.tabService.currentTab = tab;
397
+ }
398
+ openCurrentTabSubscription() {
399
+ this.tabSubscription = this.tabService.currentTab$.subscribe(value => (this.currentTab = value));
400
+ }
401
+ ngOnDestroy() {
402
+ var _a;
403
+ this.tabService.currentTab = TabEnum.GENERAL;
404
+ (_a = this.tabSubscription) === null || _a === void 0 ? void 0 : _a.unsubscribe();
405
+ }
406
+ }
407
+ ObjectManagementDetailContainerComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.2.12", ngImport: i0, type: ObjectManagementDetailContainerComponent, deps: [{ token: ObjectManagementStateService }, { token: ObjectManagementService }, { token: i3$1.ActivatedRoute }, { token: i2.ConfigService }, { token: TabService }], target: i0.ɵɵFactoryTarget.Component });
408
+ ObjectManagementDetailContainerComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "14.2.12", type: ObjectManagementDetailContainerComponent, selector: "valtimo-object-management-detail-container", ngImport: i0, template: "<!--\n ~ Copyright 2015-2022 Ritense BV, the Netherlands.\n ~\n ~ Licensed under EUPL, Version 1.2 (the \"License\");\n ~ you may not use this file except in compliance with the License.\n ~ You may obtain a copy of the License at\n ~\n ~ https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12\n ~\n ~ Unless required by applicable law or agreed to in writing, software\n ~ distributed under the License is distributed on an \"AS IS\" basis,\n ~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n ~ See the License for the specific language governing permissions and\n ~ limitations under the License.\n -->\n\n<div class=\"main-content\">\n <div class=\"container-fluid\">\n <div class=\"col-12 px-0 mb-5\">\n <valtimo-widget>\n <ng-container *ngTemplateOutlet=\"title\"></ng-container>\n <ng-container *ngTemplateOutlet=\"tabs\"></ng-container>\n <ng-container *ngTemplateOutlet=\"tabContent\"></ng-container>\n </valtimo-widget>\n </div>\n </div>\n</div>\n\n<ng-template #title>\n <div class=\"bg-light dossier-header\" *ngIf=\"object$ | async as obs\">\n <h3 class=\"dossier-title\">\n {{ obs.title }}\n <div *ngIf=\"obs.showInDataMenu\" class=\"pull-right\">\n <span class=\"badge badge-pill badge-info increase-size\">{{\n 'objectManagement.visibleInMenu' | translate\n }}</span>\n </div>\n </h3>\n </div>\n</ng-template>\n\n<ng-template #tabs>\n <ul class=\"nav nav-tabs\">\n <li class=\"nav-item\">\n <a\n id=\"general-tab\"\n class=\"nav-link clickable active\"\n data-toggle=\"tab\"\n (click)=\"displayBodyComponent(TabEnum.GENERAL)\"\n >\n {{ 'objectManagement.tabs.general' | translate }}\n </a>\n </li>\n <li class=\"nav-item\" *ngIf=\"caseListColumn\">\n <a\n id=\"list-tab\"\n class=\"nav-link clickable\"\n data-toggle=\"tab\"\n (click)=\"displayBodyComponent(TabEnum.LIST)\"\n >\n {{ 'objectManagement.tabs.list' | translate }}\n </a>\n </li>\n </ul>\n</ng-template>\n\n<ng-template #tabContent>\n <div class=\"pt-3 bg-white position-relative tab-container\">\n <div *ngIf=\"currentTab && currentTab === TabEnum.GENERAL\">\n <valtimo-object-management-detail [object$]=\"object$\"></valtimo-object-management-detail>\n </div>\n <div *ngIf=\"currentTab && currentTab === TabEnum.LIST\">\n <valtimo-object-management-list-tab></valtimo-object-management-list-tab>\n </div>\n </div>\n</ng-template>\n", styles: [".tab-container{min-height:300px}.dossier-header{height:80px;padding-top:21px;padding-left:18px;padding-right:18px;border-bottom:1px solid rgba(0,0,0,.125)}.dossier-title{margin-top:0;margin-bottom:7px}\n"], dependencies: [{ kind: "directive", type: i6.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: i6.NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }, { kind: "component", type: i6$2.WidgetComponent, selector: "valtimo-widget", inputs: ["type", "name", "icon", "contrast", "divider", "title", "subtitle", "collapseAble", "collapse", "additionalClasses"] }, { kind: "component", type: ObjectManagementDetailComponent, selector: "valtimo-object-management-detail", inputs: ["object$"] }, { kind: "component", type: ObjectManagementListTabComponent, selector: "valtimo-object-management-list-tab", inputs: ["object$"] }, { kind: "pipe", type: i6.AsyncPipe, name: "async" }, { kind: "pipe", type: i6$1.TranslatePipe, name: "translate" }] });
409
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.2.12", ngImport: i0, type: ObjectManagementDetailContainerComponent, decorators: [{
410
+ type: Component,
411
+ args: [{ selector: 'valtimo-object-management-detail-container', 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 class=\"main-content\">\n <div class=\"container-fluid\">\n <div class=\"col-12 px-0 mb-5\">\n <valtimo-widget>\n <ng-container *ngTemplateOutlet=\"title\"></ng-container>\n <ng-container *ngTemplateOutlet=\"tabs\"></ng-container>\n <ng-container *ngTemplateOutlet=\"tabContent\"></ng-container>\n </valtimo-widget>\n </div>\n </div>\n</div>\n\n<ng-template #title>\n <div class=\"bg-light dossier-header\" *ngIf=\"object$ | async as obs\">\n <h3 class=\"dossier-title\">\n {{ obs.title }}\n <div *ngIf=\"obs.showInDataMenu\" class=\"pull-right\">\n <span class=\"badge badge-pill badge-info increase-size\">{{\n 'objectManagement.visibleInMenu' | translate\n }}</span>\n </div>\n </h3>\n </div>\n</ng-template>\n\n<ng-template #tabs>\n <ul class=\"nav nav-tabs\">\n <li class=\"nav-item\">\n <a\n id=\"general-tab\"\n class=\"nav-link clickable active\"\n data-toggle=\"tab\"\n (click)=\"displayBodyComponent(TabEnum.GENERAL)\"\n >\n {{ 'objectManagement.tabs.general' | translate }}\n </a>\n </li>\n <li class=\"nav-item\" *ngIf=\"caseListColumn\">\n <a\n id=\"list-tab\"\n class=\"nav-link clickable\"\n data-toggle=\"tab\"\n (click)=\"displayBodyComponent(TabEnum.LIST)\"\n >\n {{ 'objectManagement.tabs.list' | translate }}\n </a>\n </li>\n </ul>\n</ng-template>\n\n<ng-template #tabContent>\n <div class=\"pt-3 bg-white position-relative tab-container\">\n <div *ngIf=\"currentTab && currentTab === TabEnum.GENERAL\">\n <valtimo-object-management-detail [object$]=\"object$\"></valtimo-object-management-detail>\n </div>\n <div *ngIf=\"currentTab && currentTab === TabEnum.LIST\">\n <valtimo-object-management-list-tab></valtimo-object-management-list-tab>\n </div>\n </div>\n</ng-template>\n", styles: [".tab-container{min-height:300px}.dossier-header{height:80px;padding-top:21px;padding-left:18px;padding-right:18px;border-bottom:1px solid rgba(0,0,0,.125)}.dossier-title{margin-top:0;margin-bottom:7px}\n"] }]
412
+ }], ctorParameters: function () { return [{ type: ObjectManagementStateService }, { type: ObjectManagementService }, { type: i3$1.ActivatedRoute }, { type: i2.ConfigService }, { type: TabService }]; } });
413
+
414
+ /*
415
+ * Copyright 2015-2020 Ritense BV, the Netherlands.
416
+ *
417
+ * Licensed under EUPL, Version 1.2 (the "License");
418
+ * you may not use this file except in compliance with the License.
419
+ * You may obtain a copy of the License at
420
+ *
421
+ * https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12
422
+ *
423
+ * Unless required by applicable law or agreed to in writing, software
424
+ * distributed under the License is distributed on an "AS IS" basis,
425
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
426
+ * See the License for the specific language governing permissions and
427
+ * limitations under the License.
428
+ */
429
+ class ObjectManagementUploadModalComponent {
430
+ constructor(objectManagementState, objectManagementService, formManagementService, pluginManagementService, modalService, translateService) {
431
+ this.objectManagementState = objectManagementState;
432
+ this.objectManagementService = objectManagementService;
433
+ this.formManagementService = formManagementService;
434
+ this.pluginManagementService = pluginManagementService;
435
+ this.modalService = modalService;
436
+ this.translateService = translateService;
437
+ this.clear$ = new Subject();
438
+ this.jsonString$ = new BehaviorSubject('');
439
+ this.error$ = new BehaviorSubject('');
440
+ this.disabled$ = new BehaviorSubject(false);
441
+ this.showForm$ = this.modalService.modalVisible$;
442
+ this.file$ = new BehaviorSubject(undefined);
443
+ }
444
+ ngAfterViewInit() {
445
+ this.openShowSubscription();
446
+ this.openFileSubscription();
447
+ this.openHideSubscription();
448
+ }
449
+ ngOnDestroy() {
450
+ var _a, _b;
451
+ (_a = this.showSubscription) === null || _a === void 0 ? void 0 : _a.unsubscribe();
452
+ (_b = this.hideSubscription) === null || _b === void 0 ? void 0 : _b.unsubscribe();
453
+ this.fileSubscription.unsubscribe();
454
+ }
455
+ hide() {
456
+ this.modalService.closeModal();
457
+ }
458
+ cancel() {
459
+ this.hide();
460
+ }
461
+ setFile(file) {
462
+ this.clearError();
463
+ this.file$.next(file);
464
+ }
465
+ uploadDefinition() {
466
+ this.disable();
467
+ this.jsonString$.pipe(take(1)).subscribe((objecttypeDefinition) => {
468
+ this.objectManagementService.createObject(Object.assign({}, JSON.parse(objecttypeDefinition))).subscribe(() => {
469
+ this.objectManagementState.refresh();
470
+ this.objectManagementState.hideModal();
471
+ });
472
+ this.closeErrorSubscription();
473
+ this.clearError();
474
+ this.enable();
475
+ this.hide();
476
+ });
477
+ }
478
+ openErrorSubscription(errorCode) {
479
+ this.closeErrorSubscription();
480
+ this.errorSubscription = this.translateService.stream(errorCode).subscribe(error => {
481
+ this.error$.next(error);
482
+ });
483
+ }
484
+ closeErrorSubscription() {
485
+ if (this.errorSubscription) {
486
+ this.errorSubscription.unsubscribe();
487
+ }
488
+ }
489
+ openFileSubscription() {
490
+ this.fileSubscription = this.file$.subscribe(file => {
491
+ if (file) {
492
+ const reader = new FileReader();
493
+ reader.onloadend = () => {
494
+ const result = reader.result.toString();
495
+ if (this.isValidJsonObjecttype(result)) {
496
+ this.jsonString$.next(result);
497
+ }
498
+ else {
499
+ this.clearJsonString();
500
+ }
501
+ };
502
+ reader.readAsText(file);
503
+ }
504
+ else {
505
+ this.clearJsonString();
506
+ }
507
+ });
508
+ }
509
+ openShowSubscription() {
510
+ this.showSubscription = this.objectManagementState.showModal$.subscribe(() => {
511
+ this.show();
512
+ this.clearJsonString();
513
+ this.clearError();
514
+ this.clearDropzone();
515
+ });
516
+ }
517
+ openHideSubscription() {
518
+ this.hideSubscription = this.objectManagementState.hideModal$.subscribe(() => {
519
+ this.hide();
520
+ });
521
+ }
522
+ show() {
523
+ this.objectManagementState.modalType$.pipe(take(1)).subscribe(modalType => {
524
+ if (modalType === 'upload') {
525
+ this.modalService.openModal(this.objectManagementUploadModal);
526
+ }
527
+ });
528
+ }
529
+ clearError() {
530
+ this.error$.next('');
531
+ }
532
+ clearJsonString() {
533
+ this.jsonString$.next('');
534
+ }
535
+ clearDropzone() {
536
+ this.clear$.next(null);
537
+ }
538
+ isValidJsonObjecttype(string) {
539
+ var _a;
540
+ const jsonObjecttype = JSON.parse(string);
541
+ const isValid = this.validateObject(jsonObjecttype, ['title', 'objecttypenApiPluginConfigurationId', 'objecttypeId', 'objectenApiPluginConfigurationId', 'showInDataMenu']);
542
+ const isObjecttypeTitleUnique = !((_a = this.objecttypes) === null || _a === void 0 ? void 0 : _a.find(objecttype => objecttype.title === jsonObjecttype.title));
543
+ if (isValid && isObjecttypeTitleUnique) {
544
+ return true;
545
+ }
546
+ else if (isValid && !isObjecttypeTitleUnique) {
547
+ this.clearDropzone();
548
+ this.openErrorSubscription('dropzone.error.objecttypeAlreadyExists');
549
+ return false;
550
+ }
551
+ else if (!isValid && isObjecttypeTitleUnique) {
552
+ this.clearDropzone();
553
+ this.openErrorSubscription('dropzone.error.invalidObjecttypeDef');
554
+ return false;
555
+ }
556
+ }
557
+ validateObject(obj, requiredKeys) {
558
+ const objKeys = Object.keys(obj);
559
+ return requiredKeys.every(key => objKeys.includes(key));
560
+ }
561
+ disable() {
562
+ this.disabled$.next(true);
563
+ }
564
+ enable() {
565
+ this.disabled$.next(false);
566
+ }
567
+ }
568
+ ObjectManagementUploadModalComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.2.12", ngImport: i0, type: ObjectManagementUploadModalComponent, deps: [{ token: ObjectManagementStateService }, { token: ObjectManagementService }, { token: i3.FormManagementService }, { token: i4.PluginManagementService }, { token: i5.ModalService }, { token: i6$1.TranslateService }], target: i0.ɵɵFactoryTarget.Component });
569
+ ObjectManagementUploadModalComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "14.2.12", type: ObjectManagementUploadModalComponent, selector: "valtimo-object-management-upload-modal", inputs: { objecttypes: "objecttypes" }, viewQueries: [{ propertyName: "objectManagementUploadModal", first: true, predicate: ["objectManagementUploadModal"], descendants: true }], ngImport: i0, template: "<!--\n ~ Copyright 2015-2020 Ritense BV, the Netherlands.\n ~\n ~ Licensed under EUPL, Version 1.2 (the \"License\");\n ~ you may not use this file except in compliance with the License.\n ~ You may obtain a copy of the License at\n ~\n ~ https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12\n ~\n ~ Unless required by applicable law or agreed to in writing, software\n ~ distributed under the License is distributed on an \"AS IS\" basis,\n ~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n ~ See the License for the specific language governing permissions and\n ~ limitations under the License.\n -->\n\n<v-modal #objectManagementUploadModal *ngIf=\"{\n disabled: disabled$ | async,\n jsonString: jsonString$ | async,\n error: error$ | async\n} as obs\">\n <div role=\"header\">\n <div class=\"add-title\">\n <v-title [margin]=\"false\">{{ 'objectManagement.uploadObjecttype' | translate }}</v-title>\n </div>\n </div>\n <div role=\"content\">\n <ng-container *ngTemplateOutlet=\"uploadForm\"></ng-container>\n </div>\n <div role=\"footer\">\n <div class=\"buttons\">\n <v-button (clickEvent)=\"cancel()\" [disabled]=\"obs.disabled\" type=\"secondary\">\n {{ 'objectManagement.cancel' | translate }}\n </v-button>\n <v-button (clickEvent)=\"uploadDefinition()\" [disabled]=\"obs.jsonString === '' || obs.disabled\" mdiIcon=\"plus\" type=\"success\">\n {{ 'Upload' | translate }}\n </v-button>\n </div>\n </div>\n</v-modal>\n\n<ng-template #uploadForm>\n <ng-container *ngIf=\"showForm$ | async\">\n <valtimo-dropzone\n [clear$]=\"clear$\"\n (fileSelected)=\"setFile($event)\"\n [disabled]=\"disabled$ | async\"\n [subtitle]=\"'dropzone.objecttypeDef' | translate\"\n [externalError$]=\"error$\"\n [maxFiles]=\"1\"\n ></valtimo-dropzone>\n </ng-container>\n</ng-template>\n", styles: ["/*!\n * Copyright 2015-2020 Ritense BV, the Netherlands.\n *\n * Licensed under EUPL, Version 1.2 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" basis,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */.buttons{width:100%;display:flex;flex-direction:row;justify-content:space-between}\n"], dependencies: [{ kind: "directive", type: i6.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: i6.NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }, { kind: "component", type: i6$2.DropzoneComponent, selector: "valtimo-dropzone", inputs: ["title", "hideTitle", "subtitle", "externalError$", "maxFileSize", "showMaxFileSize", "acceptedFiles", "clear$", "disabled", "hideFilePreview", "uploading", "camera", "maxFiles"], outputs: ["fileSelected"] }, { kind: "component", type: i5.ModalComponent, selector: "v-modal", inputs: ["appearingDelayMs", "maxWidthPx", "hideFooter"], outputs: ["closeEvent"] }, { kind: "component", type: i5.TitleComponent, selector: "v-title", inputs: ["type", "margin", "fullWidth", "center"] }, { kind: "component", type: i5.ButtonComponent, selector: "v-button", inputs: ["type", "mdiIcon", "disabled", "title", "titleTranslationKey"], outputs: ["clickEvent"] }, { kind: "pipe", type: i6.AsyncPipe, name: "async" }, { kind: "pipe", type: i6$1.TranslatePipe, name: "translate" }] });
570
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.2.12", ngImport: i0, type: ObjectManagementUploadModalComponent, decorators: [{
571
+ type: Component,
572
+ args: [{ selector: 'valtimo-object-management-upload-modal', template: "<!--\n ~ Copyright 2015-2020 Ritense BV, the Netherlands.\n ~\n ~ Licensed under EUPL, Version 1.2 (the \"License\");\n ~ you may not use this file except in compliance with the License.\n ~ You may obtain a copy of the License at\n ~\n ~ https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12\n ~\n ~ Unless required by applicable law or agreed to in writing, software\n ~ distributed under the License is distributed on an \"AS IS\" basis,\n ~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n ~ See the License for the specific language governing permissions and\n ~ limitations under the License.\n -->\n\n<v-modal #objectManagementUploadModal *ngIf=\"{\n disabled: disabled$ | async,\n jsonString: jsonString$ | async,\n error: error$ | async\n} as obs\">\n <div role=\"header\">\n <div class=\"add-title\">\n <v-title [margin]=\"false\">{{ 'objectManagement.uploadObjecttype' | translate }}</v-title>\n </div>\n </div>\n <div role=\"content\">\n <ng-container *ngTemplateOutlet=\"uploadForm\"></ng-container>\n </div>\n <div role=\"footer\">\n <div class=\"buttons\">\n <v-button (clickEvent)=\"cancel()\" [disabled]=\"obs.disabled\" type=\"secondary\">\n {{ 'objectManagement.cancel' | translate }}\n </v-button>\n <v-button (clickEvent)=\"uploadDefinition()\" [disabled]=\"obs.jsonString === '' || obs.disabled\" mdiIcon=\"plus\" type=\"success\">\n {{ 'Upload' | translate }}\n </v-button>\n </div>\n </div>\n</v-modal>\n\n<ng-template #uploadForm>\n <ng-container *ngIf=\"showForm$ | async\">\n <valtimo-dropzone\n [clear$]=\"clear$\"\n (fileSelected)=\"setFile($event)\"\n [disabled]=\"disabled$ | async\"\n [subtitle]=\"'dropzone.objecttypeDef' | translate\"\n [externalError$]=\"error$\"\n [maxFiles]=\"1\"\n ></valtimo-dropzone>\n </ng-container>\n</ng-template>\n", styles: ["/*!\n * Copyright 2015-2020 Ritense BV, the Netherlands.\n *\n * Licensed under EUPL, Version 1.2 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" basis,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */.buttons{width:100%;display:flex;flex-direction:row;justify-content:space-between}\n"] }]
573
+ }], ctorParameters: function () { return [{ type: ObjectManagementStateService }, { type: ObjectManagementService }, { type: i3.FormManagementService }, { type: i4.PluginManagementService }, { type: i5.ModalService }, { type: i6$1.TranslateService }]; }, propDecorators: { objectManagementUploadModal: [{
574
+ type: ViewChild,
575
+ args: ['objectManagementUploadModal']
576
+ }], objecttypes: [{
577
+ type: Input
578
+ }] } });
579
+
580
+ /*
581
+ * Copyright 2015-2020 Ritense BV, the Netherlands.
582
+ *
583
+ * Licensed under EUPL, Version 1.2 (the "License");
584
+ * you may not use this file except in compliance with the License.
585
+ * You may obtain a copy of the License at
586
+ *
587
+ * https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12
588
+ *
589
+ * Unless required by applicable law or agreed to in writing, software
590
+ * distributed under the License is distributed on an "AS IS" basis,
591
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
592
+ * See the License for the specific language governing permissions and
593
+ * limitations under the License.
594
+ */
595
+ class ObjectManagementListComponent {
596
+ constructor(objectManagementService, objectManagementState, translateService, router) {
597
+ this.objectManagementService = objectManagementService;
598
+ this.objectManagementState = objectManagementState;
599
+ this.translateService = translateService;
600
+ this.router = router;
601
+ this.loading$ = new BehaviorSubject(true);
602
+ this.fields$ = new BehaviorSubject([]);
603
+ this.objecttypesInstances$ = combineLatest([
604
+ this.translateService.stream('key'),
605
+ this.objectManagementState.refresh$
606
+ ]).pipe(tap(() => this.setFields()), switchMap$1(() => this.objectManagementService.getAllObjects()), tap(() => this.loading$.next(false)));
607
+ }
608
+ showAddModal() {
609
+ this.objectManagementState.setModalType('add');
610
+ this.objectManagementState.showModal();
611
+ }
612
+ showUploadModal() {
613
+ this.objectManagementState.setModalType('upload');
614
+ this.objectManagementState.showModal();
615
+ }
616
+ redirectToDetails(objectManagement) {
617
+ this.router.navigate(['/object-management/object', objectManagement.id]);
618
+ }
619
+ setFields() {
620
+ const keys = ['title'];
621
+ this.fields$.next(keys.map(key => ({ label: `${this.translateService.instant(`objectManagement.labels.${key}`)}`, key })));
622
+ }
623
+ }
624
+ ObjectManagementListComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.2.12", ngImport: i0, type: ObjectManagementListComponent, deps: [{ token: ObjectManagementService }, { token: ObjectManagementStateService }, { token: i6$1.TranslateService }, { token: i3$1.Router }], target: i0.ɵɵFactoryTarget.Component });
625
+ ObjectManagementListComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "14.2.12", type: ObjectManagementListComponent, selector: "valtimo-object-management-list", ngImport: i0, template: "<!--\n ~ Copyright 2015-2020 Ritense BV, the Netherlands.\n ~\n ~ Licensed under EUPL, Version 1.2 (the \"License\");\n ~ you may not use this file except in compliance with the License.\n ~ You may obtain a copy of the License at\n ~\n ~ https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12\n ~\n ~ Unless required by applicable law or agreed to in writing, software\n ~ distributed under the License is distributed on an \"AS IS\" basis,\n ~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n ~ See the License for the specific language governing permissions and\n ~ limitations under the License.\n -->\n\n<div class=\"main-content pt-0\" *ngIf=\"{loading: loading$ | async} as obs\">\n <div class=\"container-fluid\">\n <div class=\"col-12 px-0 mb-5\">\n <div class=\"text-right mt-m3px mb-3\">\n <button (click)=\"showUploadModal()\" class=\"btn btn-secondary btn-space\">\n <i class=\"icon mdi mdi-upload mr-1\"></i>\n {{ 'objectManagement.uploadObjecttype' | translate }}\n </button>\n <button (click)=\"showAddModal()\" type=\"button\" class=\"btn btn-space btn-primary mr-0\">\n <i class=\"icon mdi mdi-plus mr-1\"></i>\n {{ 'objectManagement.createObjecttype' | translate }}\n </button>\n </div>\n <ng-container *ngTemplateOutlet=\"list; context: {obs: obs}\"></ng-container>\n </div>\n </div>\n</div>\n\n<ng-template #list let-obs=\"obs\">\n <ng-container *ngIf=\"fields$ | async as fields\">\n <ng-container *ngIf=\"objecttypesInstances$ | async as objecttypesInstances\">\n <valtimo-widget *ngIf=\"obs.loading === false\">\n <valtimo-list\n [items]=\"objecttypesInstances\"\n [fields]=\"fields\"\n [viewMode]=\"true\"\n [header]=\"true\"\n paginationIdentifier=\"objecttypesList\"\n (rowClicked)=\"redirectToDetails($event)\"\n >\n <div header>\n <h3 class=\"list-header-title\">\n {{ 'objectManagement.title' | translate }}\n <sup class=\"ml-1 badge badge-pill badge-primary\">{{\n objecttypesInstances?.length || 0\n }}</sup>\n </h3>\n </div>\n </valtimo-list>\n </valtimo-widget>\n </ng-container>\n </ng-container>\n</ng-template>\n\n<valtimo-object-management-upload-modal [objecttypes]=\"objecttypesInstances$ | async\"></valtimo-object-management-upload-modal>\n<valtimo-object-management-modal></valtimo-object-management-modal>\n\n\n", styles: ["/*!\n * Copyright 2015-2020 Ritense BV, the Netherlands.\n *\n * Licensed under EUPL, Version 1.2 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" basis,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n"], dependencies: [{ kind: "directive", type: i6.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: i6.NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }, { kind: "component", type: i6$2.WidgetComponent, selector: "valtimo-widget", inputs: ["type", "name", "icon", "contrast", "divider", "title", "subtitle", "collapseAble", "collapse", "additionalClasses"] }, { kind: "component", type: i6$2.ListComponent, selector: "valtimo-list", inputs: ["items", "fields", "pagination", "viewMode", "isSearchable", "header", "actions", "paginationIdentifier", "initialSortState", "lastColumnTemplate"], outputs: ["rowClicked", "paginationClicked", "paginationSet", "search", "sortChanged"] }, { kind: "component", type: ObjectManagementModalComponent, selector: "valtimo-object-management-modal", inputs: ["prefillObject$"] }, { kind: "component", type: ObjectManagementUploadModalComponent, selector: "valtimo-object-management-upload-modal", inputs: ["objecttypes"] }, { kind: "pipe", type: i6.AsyncPipe, name: "async" }, { kind: "pipe", type: i6$1.TranslatePipe, name: "translate" }] });
626
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.2.12", ngImport: i0, type: ObjectManagementListComponent, decorators: [{
627
+ type: Component,
628
+ args: [{ selector: 'valtimo-object-management-list', template: "<!--\n ~ Copyright 2015-2020 Ritense BV, the Netherlands.\n ~\n ~ Licensed under EUPL, Version 1.2 (the \"License\");\n ~ you may not use this file except in compliance with the License.\n ~ You may obtain a copy of the License at\n ~\n ~ https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12\n ~\n ~ Unless required by applicable law or agreed to in writing, software\n ~ distributed under the License is distributed on an \"AS IS\" basis,\n ~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n ~ See the License for the specific language governing permissions and\n ~ limitations under the License.\n -->\n\n<div class=\"main-content pt-0\" *ngIf=\"{loading: loading$ | async} as obs\">\n <div class=\"container-fluid\">\n <div class=\"col-12 px-0 mb-5\">\n <div class=\"text-right mt-m3px mb-3\">\n <button (click)=\"showUploadModal()\" class=\"btn btn-secondary btn-space\">\n <i class=\"icon mdi mdi-upload mr-1\"></i>\n {{ 'objectManagement.uploadObjecttype' | translate }}\n </button>\n <button (click)=\"showAddModal()\" type=\"button\" class=\"btn btn-space btn-primary mr-0\">\n <i class=\"icon mdi mdi-plus mr-1\"></i>\n {{ 'objectManagement.createObjecttype' | translate }}\n </button>\n </div>\n <ng-container *ngTemplateOutlet=\"list; context: {obs: obs}\"></ng-container>\n </div>\n </div>\n</div>\n\n<ng-template #list let-obs=\"obs\">\n <ng-container *ngIf=\"fields$ | async as fields\">\n <ng-container *ngIf=\"objecttypesInstances$ | async as objecttypesInstances\">\n <valtimo-widget *ngIf=\"obs.loading === false\">\n <valtimo-list\n [items]=\"objecttypesInstances\"\n [fields]=\"fields\"\n [viewMode]=\"true\"\n [header]=\"true\"\n paginationIdentifier=\"objecttypesList\"\n (rowClicked)=\"redirectToDetails($event)\"\n >\n <div header>\n <h3 class=\"list-header-title\">\n {{ 'objectManagement.title' | translate }}\n <sup class=\"ml-1 badge badge-pill badge-primary\">{{\n objecttypesInstances?.length || 0\n }}</sup>\n </h3>\n </div>\n </valtimo-list>\n </valtimo-widget>\n </ng-container>\n </ng-container>\n</ng-template>\n\n<valtimo-object-management-upload-modal [objecttypes]=\"objecttypesInstances$ | async\"></valtimo-object-management-upload-modal>\n<valtimo-object-management-modal></valtimo-object-management-modal>\n\n\n", styles: ["/*!\n * Copyright 2015-2020 Ritense BV, the Netherlands.\n *\n * Licensed under EUPL, Version 1.2 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" basis,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n"] }]
629
+ }], ctorParameters: function () { return [{ type: ObjectManagementService }, { type: ObjectManagementStateService }, { type: i6$1.TranslateService }, { type: i3$1.Router }]; } });
630
+
631
+ /*
632
+ * Copyright 2015-2020 Ritense BV, the Netherlands.
633
+ *
634
+ * Licensed under EUPL, Version 1.2 (the "License");
635
+ * you may not use this file except in compliance with the License.
636
+ * You may obtain a copy of the License at
637
+ *
638
+ * https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12
639
+ *
640
+ * Unless required by applicable law or agreed to in writing, software
641
+ * distributed under the License is distributed on an "AS IS" basis,
642
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
643
+ * See the License for the specific language governing permissions and
644
+ * limitations under the License.
645
+ */
646
+ const routes = [
647
+ {
648
+ path: 'object-management',
649
+ canActivate: [AuthGuardService],
650
+ component: ObjectManagementListComponent,
651
+ data: { title: 'Objects', roles: [ROLE_ADMIN] },
652
+ },
653
+ {
654
+ path: 'object-management/object/:id',
655
+ canActivate: [AuthGuardService],
656
+ component: ObjectManagementDetailContainerComponent,
657
+ data: { title: 'Object', roles: [ROLE_ADMIN] },
658
+ }
659
+ ];
660
+ class ObjectManagementRoutingModule {
661
+ }
662
+ ObjectManagementRoutingModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.2.12", ngImport: i0, type: ObjectManagementRoutingModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
663
+ ObjectManagementRoutingModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "14.2.12", ngImport: i0, type: ObjectManagementRoutingModule, imports: [CommonModule, i3$1.RouterModule], exports: [RouterModule] });
664
+ ObjectManagementRoutingModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "14.2.12", ngImport: i0, type: ObjectManagementRoutingModule, imports: [CommonModule, RouterModule.forChild(routes), RouterModule] });
665
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.2.12", ngImport: i0, type: ObjectManagementRoutingModule, decorators: [{
666
+ type: NgModule,
667
+ args: [{
668
+ imports: [CommonModule, RouterModule.forChild(routes)],
669
+ exports: [RouterModule],
670
+ declarations: [],
671
+ }]
672
+ }] });
673
+
674
+ /*
675
+ * Copyright 2015-2020 Ritense BV, the Netherlands.
676
+ *
677
+ * Licensed under EUPL, Version 1.2 (the "License");
678
+ * you may not use this file except in compliance with the License.
679
+ * You may obtain a copy of the License at
680
+ *
681
+ * https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12
682
+ *
683
+ * Unless required by applicable law or agreed to in writing, software
684
+ * distributed under the License is distributed on an "AS IS" basis,
685
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
686
+ * See the License for the specific language governing permissions and
687
+ * limitations under the License.
688
+ */
689
+ class ObjectManagementModule {
690
+ }
691
+ ObjectManagementModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.2.12", ngImport: i0, type: ObjectManagementModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
692
+ ObjectManagementModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "14.2.12", ngImport: i0, type: ObjectManagementModule, declarations: [ObjectManagementListComponent,
693
+ ObjectManagementDetailContainerComponent,
694
+ ObjectManagementDetailComponent,
695
+ ObjectManagementListTabComponent,
696
+ ObjectManagementModalComponent,
697
+ ObjectManagementUploadModalComponent], imports: [CommonModule,
698
+ DropzoneModule,
699
+ WidgetModule,
700
+ ListModule,
701
+ TranslateModule,
702
+ ObjectManagementRoutingModule,
703
+ ModalModule,
704
+ TitleModule,
705
+ ButtonModule,
706
+ FormModule,
707
+ InputModule,
708
+ SelectModule] });
709
+ ObjectManagementModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "14.2.12", ngImport: i0, type: ObjectManagementModule, imports: [CommonModule,
710
+ DropzoneModule,
711
+ WidgetModule,
712
+ ListModule,
713
+ TranslateModule,
714
+ ObjectManagementRoutingModule,
715
+ ModalModule,
716
+ TitleModule,
717
+ ButtonModule,
718
+ FormModule,
719
+ InputModule,
720
+ SelectModule] });
721
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.2.12", ngImport: i0, type: ObjectManagementModule, decorators: [{
722
+ type: NgModule,
723
+ args: [{
724
+ declarations: [
725
+ ObjectManagementListComponent,
726
+ ObjectManagementDetailContainerComponent,
727
+ ObjectManagementDetailComponent,
728
+ ObjectManagementListTabComponent,
729
+ ObjectManagementModalComponent,
730
+ ObjectManagementUploadModalComponent
731
+ ],
732
+ imports: [
733
+ CommonModule,
734
+ DropzoneModule,
735
+ WidgetModule,
736
+ ListModule,
737
+ TranslateModule,
738
+ ObjectManagementRoutingModule,
739
+ ModalModule,
740
+ TitleModule,
741
+ ButtonModule,
742
+ FormModule,
743
+ InputModule,
744
+ SelectModule
745
+ ],
746
+ exports: []
747
+ }]
748
+ }] });
749
+
750
+ /*
751
+ * Copyright 2015-2020 Ritense BV, the Netherlands.
752
+ *
753
+ * Licensed under EUPL, Version 1.2 (the "License");
754
+ * you may not use this file except in compliance with the License.
755
+ * You may obtain a copy of the License at
756
+ *
757
+ * https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12
758
+ *
759
+ * Unless required by applicable law or agreed to in writing, software
760
+ * distributed under the License is distributed on an "AS IS" basis,
761
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
762
+ * See the License for the specific language governing permissions and
763
+ * limitations under the License.
764
+ */
765
+
766
+ /**
767
+ * Generated bundle index. Do not edit.
768
+ */
769
+
770
+ export { ObjectManagementModule, ObjectManagementService };
771
+ //# sourceMappingURL=valtimo-object-management.mjs.map