@valtimo/choice-field 4.15.2-next-main.15 → 4.15.3-next-main.16

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (30) hide show
  1. package/bundles/valtimo-choice-field.umd.js +719 -713
  2. package/bundles/valtimo-choice-field.umd.js.map +1 -1
  3. package/bundles/valtimo-choice-field.umd.min.js +1 -1
  4. package/bundles/valtimo-choice-field.umd.min.js.map +1 -1
  5. package/esm2015/lib/choice-field-create/choice-field-create.component.js +63 -63
  6. package/esm2015/lib/choice-field-detail/choice-field-detail.component.js +123 -122
  7. package/esm2015/lib/choice-field-list/choice-field-list.component.js +75 -74
  8. package/esm2015/lib/choice-field-routing.module.js +83 -86
  9. package/esm2015/lib/choice-field-value-create/choice-field-value-create.component.js +82 -82
  10. package/esm2015/lib/choice-field-value-detail/choice-field-value-detail.component.js +88 -88
  11. package/esm2015/lib/choice-field-value-list/choice-field-value-list.component.js +100 -96
  12. package/esm2015/lib/choice-field.module.js +54 -54
  13. package/esm2015/lib/choice-field.service.js +71 -68
  14. package/esm2015/public_api.js +21 -21
  15. package/esm2015/valtimo-choice-field.js +12 -12
  16. package/fesm2015/valtimo-choice-field.js +679 -673
  17. package/fesm2015/valtimo-choice-field.js.map +1 -1
  18. package/lib/choice-field-create/choice-field-create.component.d.ts +20 -20
  19. package/lib/choice-field-detail/choice-field-detail.component.d.ts +30 -30
  20. package/lib/choice-field-list/choice-field-list.component.d.ts +23 -23
  21. package/lib/choice-field-routing.module.d.ts +2 -2
  22. package/lib/choice-field-value-create/choice-field-value-create.component.d.ts +26 -26
  23. package/lib/choice-field-value-detail/choice-field-value-detail.component.d.ts +27 -27
  24. package/lib/choice-field-value-list/choice-field-value-list.component.d.ts +29 -29
  25. package/lib/choice-field.module.d.ts +2 -2
  26. package/lib/choice-field.service.d.ts +18 -18
  27. package/package.json +1 -1
  28. package/public_api.d.ts +2 -2
  29. package/valtimo-choice-field.d.ts +11 -11
  30. package/valtimo-choice-field.metadata.json +1 -1
@@ -4,739 +4,745 @@
4
4
  (global = global || self, factory((global.valtimo = global.valtimo || {}, global.valtimo['choice-field'] = {}), global.ng.core, global.ng.common.http, global.config, global.ng.common, global.ng.forms, global.components, global.ng.router, global.security, global.rxjs, global.rxjs.operators, global.contract, global.core$1));
5
5
  }(this, (function (exports, i0, i1, i2, common, forms, components, router, security, rxjs, operators, contract, core) { 'use strict';
6
6
 
7
- /*
8
- * Copyright 2015-2020 Ritense BV, the Netherlands.
9
- *
10
- * Licensed under EUPL, Version 1.2 (the "License");
11
- * you may not use this file except in compliance with the License.
12
- * You may obtain a copy of the License at
13
- *
14
- * https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12
15
- *
16
- * Unless required by applicable law or agreed to in writing, software
17
- * distributed under the License is distributed on an "AS IS" basis,
18
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
19
- * See the License for the specific language governing permissions and
20
- * limitations under the License.
21
- */
22
- var ChoiceFieldService = /** @class */ (function () {
23
- function ChoiceFieldService(http, configService) {
24
- this.http = http;
25
- this.configService = configService;
26
- this.valtimoApiConfig = configService.config.valtimoApi;
27
- }
28
- ChoiceFieldService.prototype.query = function (params) {
29
- return this.http.get(this.valtimoApiConfig.endpointUri + "choice-fields", { observe: 'response', params: params });
30
- };
31
- ChoiceFieldService.prototype.get = function (id) {
32
- return this.http.get(this.valtimoApiConfig.endpointUri + "choice-fields/" + id);
33
- };
34
- ChoiceFieldService.prototype.create = function (choiceField) {
35
- return this.http.post(this.valtimoApiConfig.endpointUri + "choice-fields", choiceField);
36
- };
37
- ChoiceFieldService.prototype.delete = function (id) {
38
- return this.http.delete(this.valtimoApiConfig.endpointUri + "choice-fields/" + id);
39
- };
40
- ChoiceFieldService.prototype.update = function (choiceField) {
41
- return this.http.put(this.valtimoApiConfig.endpointUri + "choice-fields", choiceField);
42
- };
43
- ChoiceFieldService.prototype.queryValues = function (keyName, params) {
44
- return this.http.get(this.valtimoApiConfig.endpointUri + "choice-field-values/" + keyName + "/values", { observe: 'response', params: params });
45
- };
46
- ChoiceFieldService.prototype.getValue = function (choiceFieldId) {
47
- return this.http.get(this.valtimoApiConfig.endpointUri + "choice-field-values/" + choiceFieldId);
48
- };
49
- ChoiceFieldService.prototype.updateValue = function (choiceFieldValue, choiceFieldName) {
50
- return this.http.put(this.valtimoApiConfig.endpointUri + "choice-field-values", choiceFieldValue, {
51
- params: { choice_field_name: choiceFieldName }
52
- });
53
- };
54
- ChoiceFieldService.prototype.createValue = function (choiceFieldValue, choiceFieldName) {
55
- return this.http.post(this.valtimoApiConfig.endpointUri + "choice-field-values", choiceFieldValue, { params: { choice_field_name: choiceFieldName } });
56
- };
57
- return ChoiceFieldService;
58
- }());
59
- ChoiceFieldService.ɵprov = i0.ɵɵdefineInjectable({ factory: function ChoiceFieldService_Factory() { return new ChoiceFieldService(i0.ɵɵinject(i1.HttpClient), i0.ɵɵinject(i2.ConfigService)); }, token: ChoiceFieldService, providedIn: "root" });
60
- ChoiceFieldService.decorators = [
61
- { type: i0.Injectable, args: [{
62
- providedIn: 'root'
63
- },] }
64
- ];
65
- ChoiceFieldService.ctorParameters = function () { return [
66
- { type: i1.HttpClient },
67
- { type: i2.ConfigService }
7
+ /*
8
+ * Copyright 2015-2020 Ritense BV, the Netherlands.
9
+ *
10
+ * Licensed under EUPL, Version 1.2 (the "License");
11
+ * you may not use this file except in compliance with the License.
12
+ * You may obtain a copy of the License at
13
+ *
14
+ * https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12
15
+ *
16
+ * Unless required by applicable law or agreed to in writing, software
17
+ * distributed under the License is distributed on an "AS IS" basis,
18
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
19
+ * See the License for the specific language governing permissions and
20
+ * limitations under the License.
21
+ */
22
+ var ChoiceFieldService = /** @class */ (function () {
23
+ function ChoiceFieldService(http, configService) {
24
+ this.http = http;
25
+ this.configService = configService;
26
+ this.valtimoApiConfig = configService.config.valtimoApi;
27
+ }
28
+ ChoiceFieldService.prototype.query = function (params) {
29
+ return this.http.get(this.valtimoApiConfig.endpointUri + "choice-fields", {
30
+ observe: 'response',
31
+ params: params,
32
+ });
33
+ };
34
+ ChoiceFieldService.prototype.get = function (id) {
35
+ return this.http.get(this.valtimoApiConfig.endpointUri + "choice-fields/" + id);
36
+ };
37
+ ChoiceFieldService.prototype.create = function (choiceField) {
38
+ return this.http.post(this.valtimoApiConfig.endpointUri + "choice-fields", choiceField);
39
+ };
40
+ ChoiceFieldService.prototype.delete = function (id) {
41
+ return this.http.delete(this.valtimoApiConfig.endpointUri + "choice-fields/" + id);
42
+ };
43
+ ChoiceFieldService.prototype.update = function (choiceField) {
44
+ return this.http.put(this.valtimoApiConfig.endpointUri + "choice-fields", choiceField);
45
+ };
46
+ ChoiceFieldService.prototype.queryValues = function (keyName, params) {
47
+ return this.http.get(this.valtimoApiConfig.endpointUri + "choice-field-values/" + keyName + "/values", { observe: 'response', params: params });
48
+ };
49
+ ChoiceFieldService.prototype.getValue = function (choiceFieldId) {
50
+ return this.http.get(this.valtimoApiConfig.endpointUri + "choice-field-values/" + choiceFieldId);
51
+ };
52
+ ChoiceFieldService.prototype.updateValue = function (choiceFieldValue, choiceFieldName) {
53
+ return this.http.put(this.valtimoApiConfig.endpointUri + "choice-field-values", choiceFieldValue, {
54
+ params: { choice_field_name: choiceFieldName },
55
+ });
56
+ };
57
+ ChoiceFieldService.prototype.createValue = function (choiceFieldValue, choiceFieldName) {
58
+ return this.http.post(this.valtimoApiConfig.endpointUri + "choice-field-values", choiceFieldValue, { params: { choice_field_name: choiceFieldName } });
59
+ };
60
+ return ChoiceFieldService;
61
+ }());
62
+ ChoiceFieldService.ɵprov = i0.ɵɵdefineInjectable({ factory: function ChoiceFieldService_Factory() { return new ChoiceFieldService(i0.ɵɵinject(i1.HttpClient), i0.ɵɵinject(i2.ConfigService)); }, token: ChoiceFieldService, providedIn: "root" });
63
+ ChoiceFieldService.decorators = [
64
+ { type: i0.Injectable, args: [{
65
+ providedIn: 'root',
66
+ },] }
67
+ ];
68
+ ChoiceFieldService.ctorParameters = function () { return [
69
+ { type: i1.HttpClient },
70
+ { type: i2.ConfigService }
68
71
  ]; };
69
72
 
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
- var ChoiceFieldListComponent = /** @class */ (function () {
86
- function ChoiceFieldListComponent(router, service) {
87
- this.router = router;
88
- this.service = service;
89
- this.choiceFields = [];
90
- this.pagination = {
91
- collectionSize: 0,
92
- page: 1,
93
- size: 10,
94
- maxPaginationItemSize: 5
95
- };
96
- this.pageParam = 0;
97
- this.fields = [{
98
- key: 'id',
99
- label: 'ID'
100
- },
101
- {
102
- key: 'keyName',
103
- label: 'Key'
104
- },
105
- {
106
- key: 'title',
107
- label: 'Title'
108
- }];
109
- }
110
- ChoiceFieldListComponent.prototype.ngOnInit = function () {
111
- };
112
- ChoiceFieldListComponent.prototype.paginationSet = function () {
113
- this.initData();
114
- };
115
- ChoiceFieldListComponent.prototype.initData = function () {
116
- var _this = this;
117
- this.service.query({ page: this.pageParam, size: this.pagination.size }).subscribe(function (results) {
118
- _this.pagination.collectionSize = results.headers.get('x-total-count');
119
- _this.choiceFields = results.body;
120
- });
121
- };
122
- ChoiceFieldListComponent.prototype.rowClick = function (data) {
123
- this.router.navigate(["/choice-fields/field/" + encodeURI(data.id)]);
124
- };
125
- ChoiceFieldListComponent.prototype.paginationClicked = function (page) {
126
- this.pageParam = page - 1;
127
- this.initData();
128
- };
129
- return ChoiceFieldListComponent;
130
- }());
131
- ChoiceFieldListComponent.decorators = [
132
- { type: i0.Component, args: [{
133
- selector: 'valtimo-choice-field-list',
134
- 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\">\n <div class=\"container-fluid\">\n <div class=\"text-right\">\n <div class=\"btn-group mt-m3px mb-3\">\n <button [routerLink]=\"'create'\" class=\"btn btn-primary btn-space mr-0\">\n <i class=\"icon mdi mdi-plus\"></i> &nbsp;\n <span>{{ 'Create new Choice field' | translate }}</span>\n </button>\n </div>\n </div>\n <valtimo-widget>\n <valtimo-list [items]=\"choiceFields\"\n [fields]=\"fields\"\n (rowClicked)=\"rowClick($event)\"\n [pagination]=\"pagination\"\n [viewMode]=\"true\"\n [isSearchable]=\"true\"\n paginationIdentifier=\"choiceFieldList\"\n (paginationClicked)=\"paginationClicked($event)\"\n (paginationSet)=\"paginationSet()\"\n [header]=\"true\"\n >\n <div header>\n <h3 class=\"list-header-title\">{{ 'Choice fields' | translate }}</h3>\n <h5 class=\"list-header-description\">{{ 'Overview of all Choice fields' | translate }}</h5>\n </div>\n </valtimo-list>\n </valtimo-widget>\n </div>\n</div>\n",
135
- styles: [""]
136
- },] }
137
- ];
138
- ChoiceFieldListComponent.ctorParameters = function () { return [
139
- { type: router.Router },
140
- { type: ChoiceFieldService }
73
+ /*
74
+ * Copyright 2015-2020 Ritense BV, the Netherlands.
75
+ *
76
+ * Licensed under EUPL, Version 1.2 (the "License");
77
+ * you may not use this file except in compliance with the License.
78
+ * You may obtain a copy of the License at
79
+ *
80
+ * https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12
81
+ *
82
+ * Unless required by applicable law or agreed to in writing, software
83
+ * distributed under the License is distributed on an "AS IS" basis,
84
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
85
+ * See the License for the specific language governing permissions and
86
+ * limitations under the License.
87
+ */
88
+ var ChoiceFieldListComponent = /** @class */ (function () {
89
+ function ChoiceFieldListComponent(router, service) {
90
+ this.router = router;
91
+ this.service = service;
92
+ this.choiceFields = [];
93
+ this.pagination = {
94
+ collectionSize: 0,
95
+ page: 1,
96
+ size: 10,
97
+ maxPaginationItemSize: 5,
98
+ };
99
+ this.pageParam = 0;
100
+ this.fields = [
101
+ {
102
+ key: 'id',
103
+ label: 'ID',
104
+ },
105
+ {
106
+ key: 'keyName',
107
+ label: 'Key',
108
+ },
109
+ {
110
+ key: 'title',
111
+ label: 'Title',
112
+ },
113
+ ];
114
+ }
115
+ ChoiceFieldListComponent.prototype.ngOnInit = function () { };
116
+ ChoiceFieldListComponent.prototype.paginationSet = function () {
117
+ this.initData();
118
+ };
119
+ ChoiceFieldListComponent.prototype.initData = function () {
120
+ var _this = this;
121
+ this.service.query({ page: this.pageParam, size: this.pagination.size }).subscribe(function (results) {
122
+ _this.pagination.collectionSize = results.headers.get('x-total-count');
123
+ _this.choiceFields = results.body;
124
+ });
125
+ };
126
+ ChoiceFieldListComponent.prototype.rowClick = function (data) {
127
+ this.router.navigate(["/choice-fields/field/" + encodeURI(data.id)]);
128
+ };
129
+ ChoiceFieldListComponent.prototype.paginationClicked = function (page) {
130
+ this.pageParam = page - 1;
131
+ this.initData();
132
+ };
133
+ return ChoiceFieldListComponent;
134
+ }());
135
+ ChoiceFieldListComponent.decorators = [
136
+ { type: i0.Component, args: [{
137
+ selector: 'valtimo-choice-field-list',
138
+ 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\">\n <div class=\"container-fluid\">\n <div class=\"text-right\">\n <div class=\"btn-group mt-m3px mb-3\">\n <button [routerLink]=\"'create'\" class=\"btn btn-primary btn-space mr-0\">\n <i class=\"icon mdi mdi-plus\"></i> &nbsp;\n <span>{{ 'Create new Choice field' | translate }}</span>\n </button>\n </div>\n </div>\n <valtimo-widget>\n <valtimo-list\n [items]=\"choiceFields\"\n [fields]=\"fields\"\n (rowClicked)=\"rowClick($event)\"\n [pagination]=\"pagination\"\n [viewMode]=\"true\"\n [isSearchable]=\"true\"\n paginationIdentifier=\"choiceFieldList\"\n (paginationClicked)=\"paginationClicked($event)\"\n (paginationSet)=\"paginationSet()\"\n [header]=\"true\"\n >\n <div header>\n <h3 class=\"list-header-title\">{{ 'Choice fields' | translate }}</h3>\n <h5 class=\"list-header-description\">{{ 'Overview of all Choice fields' | translate }}</h5>\n </div>\n </valtimo-list>\n </valtimo-widget>\n </div>\n</div>\n",
139
+ styles: [""]
140
+ },] }
141
+ ];
142
+ ChoiceFieldListComponent.ctorParameters = function () { return [
143
+ { type: router.Router },
144
+ { type: ChoiceFieldService }
141
145
  ]; };
142
146
 
143
- /*
144
- * Copyright 2015-2020 Ritense BV, the Netherlands.
145
- *
146
- * Licensed under EUPL, Version 1.2 (the "License");
147
- * you may not use this file except in compliance with the License.
148
- * You may obtain a copy of the License at
149
- *
150
- * https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12
151
- *
152
- * Unless required by applicable law or agreed to in writing, software
153
- * distributed under the License is distributed on an "AS IS" basis,
154
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
155
- * See the License for the specific language governing permissions and
156
- * limitations under the License.
157
- */
158
- var ChoiceFieldDetailComponent = /** @class */ (function () {
159
- function ChoiceFieldDetailComponent(router, route, formBuilder, service, alertService) {
160
- this.router = router;
161
- this.route = route;
162
- this.formBuilder = formBuilder;
163
- this.service = service;
164
- this.alertService = alertService;
165
- this.alertSub = rxjs.Subscription.EMPTY;
166
- var snapshot = this.route.snapshot.paramMap;
167
- this.id = snapshot.get('id');
168
- }
169
- ChoiceFieldDetailComponent.prototype.ngOnInit = function () {
170
- this.reset();
171
- };
172
- ChoiceFieldDetailComponent.prototype.ngOnDestroy = function () {
173
- this.alertSub.unsubscribe();
174
- };
175
- Object.defineProperty(ChoiceFieldDetailComponent.prototype, "formControls", {
176
- get: function () {
177
- return this.form.controls;
178
- },
179
- enumerable: false,
180
- configurable: true
181
- });
182
- ChoiceFieldDetailComponent.prototype.initData = function (id) {
183
- var _this = this;
184
- this.service.get(id).subscribe(function (result) {
185
- _this.choiceField = result;
186
- _this.setValues();
187
- });
188
- };
189
- ChoiceFieldDetailComponent.prototype.setValues = function () {
190
- if (this.choiceField) {
191
- // set form values
192
- this.form.controls.id.setValue(this.choiceField.id);
193
- this.form.controls.keyName.setValue(this.choiceField.keyName);
194
- this.form.controls.title.setValue(this.choiceField.title);
195
- }
196
- };
197
- ChoiceFieldDetailComponent.prototype.createFormGroup = function () {
198
- return this.formBuilder.group({
199
- id: new forms.FormControl('', forms.Validators.required),
200
- keyName: new forms.FormControl('', forms.Validators.required),
201
- title: new forms.FormControl('', forms.Validators.required)
202
- });
203
- };
204
- ChoiceFieldDetailComponent.prototype.reset = function () {
205
- this.form = this.createFormGroup();
206
- this.initData(this.id);
207
- };
208
- ChoiceFieldDetailComponent.prototype.delete = function () {
209
- var _this = this;
210
- if (!this.alertSub.closed) {
211
- return;
212
- }
213
- // confirm delete
214
- var mssg = 'Delete choice field?';
215
- var confirmations = [
216
- {
217
- label: 'Cancel',
218
- class: 'btn btn-default',
219
- value: false
220
- },
221
- {
222
- label: 'Delete',
223
- class: 'btn btn-primary',
224
- value: true
225
- }
226
- ];
227
- this.alertService.notification(mssg, confirmations);
228
- this.alertSub = this.alertService.getAlertConfirmChangeEmitter()
229
- .pipe(operators.first())
230
- .subscribe(function (alert) {
231
- if (alert.confirm === true) {
232
- _this.deleteConfirmed();
233
- }
234
- });
235
- };
236
- ChoiceFieldDetailComponent.prototype.deleteConfirmed = function () {
237
- var _this = this;
238
- this.service.delete(this.id).subscribe(function () {
239
- _this.router.navigate(["/choice-fields"]);
240
- _this.alertService.success('Choice field has been deleted');
241
- });
242
- };
243
- ChoiceFieldDetailComponent.prototype.onSubmit = function () {
244
- var _this = this;
245
- this.service.update(this.form.value).subscribe(function () {
246
- _this.reset();
247
- _this.alertService.success('Choice field details have been updated');
248
- });
249
- };
250
- return ChoiceFieldDetailComponent;
251
- }());
252
- ChoiceFieldDetailComponent.decorators = [
253
- { type: i0.Component, args: [{
254
- selector: 'valtimo-choice-field-detail',
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 class=\"main-content\">\n <div class=\"container-fluid\">\n <div class=\"col-12 px-0 mb-5\">\n <valtimo-widget *ngIf=\"choiceField\">\n <div>\n <div class=\"card-body bg-light\">\n <div class=\"row py-5\">\n <div class=\"col-12\">\n <div class=\"row mb-3\">\n <div class=\"col-12 col-sm-3 text-sm-right\"><strong>ID</strong></div>\n <div class=\"col-12 col-sm-8 col-lg-6\">{{ choiceField.id }}</div>\n </div>\n <div class=\"row\">\n <div class=\"col-12 col-sm-3 text-sm-right\"><strong>Key</strong></div>\n <div class=\"col-12 col-sm-8 col-lg-6\">{{ choiceField.keyName }}</div>\n </div>\n </div>\n </div>\n </div>\n\n <div class=\"p-5 bg-white\">\n <form [formGroup]=\"form\" (ngSubmit)=\"onSubmit()\">\n <div class=\"form-group row\">\n <label class=\"col-12 col-sm-3 col-form-label text-sm-right\" for=\"title\">Title</label>\n <div class=\"col-12 col-sm-8 col-lg-6\">\n <input valtimoFieldAutoFocus type=\"text\" id=\"title\" formControlName=\"title\" class=\"form-control\" placeholder=\"Choice field title\"\n [ngClass]=\"{'is-valid': formControls.title.touched && formControls.title.valid, 'is-invalid': formControls.title.touched && formControls.title.errors}\"\n required/>\n <div *ngIf=\"formControls.title.touched && formControls.title.errors\" class=\"invalid-feedback\">\n <div *ngIf=\"formControls.title.errors.required\">Title is required</div>\n </div>\n </div>\n </div>\n\n <div class=\"row pt-3 mt-1\">\n <div class=\"col-12 col-sm-6 text-left\">\n <a [routerLink]=\"'/choice-fields'\" class=\"btn btn-space btn-default\">Back</a>\n <button class=\"btn btn-space btn-danger\" type=\"button\" (click)=\"delete()\">Delete</button>\n </div>\n <div class=\"col-12 col-sm-6 text-right\">\n <button class=\"btn btn-space btn-secondary\" type=\"button\" (click)=\"reset()\">Reset</button>\n <button class=\"btn btn-space btn-primary\" type=\"submit\" [disabled]=\"form.invalid\">Submit</button>\n </div>\n </div>\n </form>\n </div>\n </div>\n </valtimo-widget>\n </div>\n </div>\n</div>\n\n<div class=\"page-head\">\n <h2 class=\"page-head-title\">Choice field values</h2>\n</div>\n<valtimo-choice-field-value-list></valtimo-choice-field-value-list>\n",
256
- styles: [""]
257
- },] }
258
- ];
259
- ChoiceFieldDetailComponent.ctorParameters = function () { return [
260
- { type: router.Router },
261
- { type: router.ActivatedRoute },
262
- { type: forms.FormBuilder },
263
- { type: ChoiceFieldService },
264
- { type: components.AlertService }
147
+ /*
148
+ * Copyright 2015-2020 Ritense BV, the Netherlands.
149
+ *
150
+ * Licensed under EUPL, Version 1.2 (the "License");
151
+ * you may not use this file except in compliance with the License.
152
+ * You may obtain a copy of the License at
153
+ *
154
+ * https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12
155
+ *
156
+ * Unless required by applicable law or agreed to in writing, software
157
+ * distributed under the License is distributed on an "AS IS" basis,
158
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
159
+ * See the License for the specific language governing permissions and
160
+ * limitations under the License.
161
+ */
162
+ var ChoiceFieldDetailComponent = /** @class */ (function () {
163
+ function ChoiceFieldDetailComponent(router, route, formBuilder, service, alertService) {
164
+ this.router = router;
165
+ this.route = route;
166
+ this.formBuilder = formBuilder;
167
+ this.service = service;
168
+ this.alertService = alertService;
169
+ this.alertSub = rxjs.Subscription.EMPTY;
170
+ var snapshot = this.route.snapshot.paramMap;
171
+ this.id = snapshot.get('id');
172
+ }
173
+ ChoiceFieldDetailComponent.prototype.ngOnInit = function () {
174
+ this.reset();
175
+ };
176
+ ChoiceFieldDetailComponent.prototype.ngOnDestroy = function () {
177
+ this.alertSub.unsubscribe();
178
+ };
179
+ Object.defineProperty(ChoiceFieldDetailComponent.prototype, "formControls", {
180
+ get: function () {
181
+ return this.form.controls;
182
+ },
183
+ enumerable: false,
184
+ configurable: true
185
+ });
186
+ ChoiceFieldDetailComponent.prototype.initData = function (id) {
187
+ var _this = this;
188
+ this.service.get(id).subscribe(function (result) {
189
+ _this.choiceField = result;
190
+ _this.setValues();
191
+ });
192
+ };
193
+ ChoiceFieldDetailComponent.prototype.setValues = function () {
194
+ if (this.choiceField) {
195
+ // set form values
196
+ this.form.controls.id.setValue(this.choiceField.id);
197
+ this.form.controls.keyName.setValue(this.choiceField.keyName);
198
+ this.form.controls.title.setValue(this.choiceField.title);
199
+ }
200
+ };
201
+ ChoiceFieldDetailComponent.prototype.createFormGroup = function () {
202
+ return this.formBuilder.group({
203
+ id: new forms.FormControl('', forms.Validators.required),
204
+ keyName: new forms.FormControl('', forms.Validators.required),
205
+ title: new forms.FormControl('', forms.Validators.required),
206
+ });
207
+ };
208
+ ChoiceFieldDetailComponent.prototype.reset = function () {
209
+ this.form = this.createFormGroup();
210
+ this.initData(this.id);
211
+ };
212
+ ChoiceFieldDetailComponent.prototype.delete = function () {
213
+ var _this = this;
214
+ if (!this.alertSub.closed) {
215
+ return;
216
+ }
217
+ // confirm delete
218
+ var mssg = 'Delete choice field?';
219
+ var confirmations = [
220
+ {
221
+ label: 'Cancel',
222
+ class: 'btn btn-default',
223
+ value: false,
224
+ },
225
+ {
226
+ label: 'Delete',
227
+ class: 'btn btn-primary',
228
+ value: true,
229
+ },
230
+ ];
231
+ this.alertService.notification(mssg, confirmations);
232
+ this.alertSub = this.alertService
233
+ .getAlertConfirmChangeEmitter()
234
+ .pipe(operators.first())
235
+ .subscribe(function (alert) {
236
+ if (alert.confirm === true) {
237
+ _this.deleteConfirmed();
238
+ }
239
+ });
240
+ };
241
+ ChoiceFieldDetailComponent.prototype.deleteConfirmed = function () {
242
+ var _this = this;
243
+ this.service.delete(this.id).subscribe(function () {
244
+ _this.router.navigate(["/choice-fields"]);
245
+ _this.alertService.success('Choice field has been deleted');
246
+ });
247
+ };
248
+ ChoiceFieldDetailComponent.prototype.onSubmit = function () {
249
+ var _this = this;
250
+ this.service.update(this.form.value).subscribe(function () {
251
+ _this.reset();
252
+ _this.alertService.success('Choice field details have been updated');
253
+ });
254
+ };
255
+ return ChoiceFieldDetailComponent;
256
+ }());
257
+ ChoiceFieldDetailComponent.decorators = [
258
+ { type: i0.Component, args: [{
259
+ selector: 'valtimo-choice-field-detail',
260
+ 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\">\n <div class=\"container-fluid\">\n <div class=\"col-12 px-0 mb-5\">\n <valtimo-widget *ngIf=\"choiceField\">\n <div>\n <div class=\"card-body bg-light\">\n <div class=\"row py-5\">\n <div class=\"col-12\">\n <div class=\"row mb-3\">\n <div class=\"col-12 col-sm-3 text-sm-right\"><strong>ID</strong></div>\n <div class=\"col-12 col-sm-8 col-lg-6\">{{ choiceField.id }}</div>\n </div>\n <div class=\"row\">\n <div class=\"col-12 col-sm-3 text-sm-right\"><strong>Key</strong></div>\n <div class=\"col-12 col-sm-8 col-lg-6\">{{ choiceField.keyName }}</div>\n </div>\n </div>\n </div>\n </div>\n\n <div class=\"p-5 bg-white\">\n <form [formGroup]=\"form\" (ngSubmit)=\"onSubmit()\">\n <div class=\"form-group row\">\n <label class=\"col-12 col-sm-3 col-form-label text-sm-right\" for=\"title\"\n >Title</label\n >\n <div class=\"col-12 col-sm-8 col-lg-6\">\n <input\n valtimoFieldAutoFocus\n type=\"text\"\n id=\"title\"\n formControlName=\"title\"\n class=\"form-control\"\n placeholder=\"Choice field title\"\n [ngClass]=\"{\n 'is-valid': formControls.title.touched && formControls.title.valid,\n 'is-invalid': formControls.title.touched && formControls.title.errors\n }\"\n required\n />\n <div\n *ngIf=\"formControls.title.touched && formControls.title.errors\"\n class=\"invalid-feedback\"\n >\n <div *ngIf=\"formControls.title.errors.required\">Title is required</div>\n </div>\n </div>\n </div>\n\n <div class=\"row pt-3 mt-1\">\n <div class=\"col-12 col-sm-6 text-left\">\n <a [routerLink]=\"'/choice-fields'\" class=\"btn btn-space btn-default\">Back</a>\n <button class=\"btn btn-space btn-danger\" type=\"button\" (click)=\"delete()\">\n Delete\n </button>\n </div>\n <div class=\"col-12 col-sm-6 text-right\">\n <button class=\"btn btn-space btn-secondary\" type=\"button\" (click)=\"reset()\">\n Reset\n </button>\n <button class=\"btn btn-space btn-primary\" type=\"submit\" [disabled]=\"form.invalid\">\n Submit\n </button>\n </div>\n </div>\n </form>\n </div>\n </div>\n </valtimo-widget>\n </div>\n </div>\n</div>\n\n<div class=\"page-head\">\n <h2 class=\"page-head-title\">Choice field values</h2>\n</div>\n<valtimo-choice-field-value-list></valtimo-choice-field-value-list>\n",
261
+ styles: [""]
262
+ },] }
263
+ ];
264
+ ChoiceFieldDetailComponent.ctorParameters = function () { return [
265
+ { type: router.Router },
266
+ { type: router.ActivatedRoute },
267
+ { type: forms.FormBuilder },
268
+ { type: ChoiceFieldService },
269
+ { type: components.AlertService }
265
270
  ]; };
266
271
 
267
- /*
268
- * Copyright 2015-2020 Ritense BV, the Netherlands.
269
- *
270
- * Licensed under EUPL, Version 1.2 (the "License");
271
- * you may not use this file except in compliance with the License.
272
- * You may obtain a copy of the License at
273
- *
274
- * https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12
275
- *
276
- * Unless required by applicable law or agreed to in writing, software
277
- * distributed under the License is distributed on an "AS IS" basis,
278
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
279
- * See the License for the specific language governing permissions and
280
- * limitations under the License.
281
- */
282
- var ChoiceFieldCreateComponent = /** @class */ (function () {
283
- function ChoiceFieldCreateComponent(router, formBuilder, service, alertService) {
284
- this.router = router;
285
- this.formBuilder = formBuilder;
286
- this.service = service;
287
- this.alertService = alertService;
288
- }
289
- ChoiceFieldCreateComponent.prototype.ngOnInit = function () {
290
- this.reset();
291
- };
292
- Object.defineProperty(ChoiceFieldCreateComponent.prototype, "formControls", {
293
- get: function () {
294
- return this.form.controls;
295
- },
296
- enumerable: false,
297
- configurable: true
298
- });
299
- ChoiceFieldCreateComponent.prototype.createFormGroup = function () {
300
- return this.formBuilder.group({
301
- keyName: new forms.FormControl('', forms.Validators.required),
302
- title: new forms.FormControl('', forms.Validators.required)
303
- });
304
- };
305
- ChoiceFieldCreateComponent.prototype.onSubmit = function () {
306
- var _this = this;
307
- this.service.create(this.form.value).subscribe(function (result) {
308
- _this.router.navigate(["/choice-fields/field/" + result.id]);
309
- _this.alertService.success('New choice field has been created');
310
- });
311
- };
312
- ChoiceFieldCreateComponent.prototype.reset = function () {
313
- this.form = this.createFormGroup();
314
- };
315
- return ChoiceFieldCreateComponent;
316
- }());
317
- ChoiceFieldCreateComponent.decorators = [
318
- { type: i0.Component, args: [{
319
- selector: 'valtimo-choice-field-create',
320
- 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\">\n <div class=\"container-fluid\">\n <div class=\"col-12 px-0 mb-5\">\n <valtimo-widget>\n <div>\n <div class=\"p-5 bg-white\">\n <form [formGroup]=\"form\" (ngSubmit)=\"onSubmit()\">\n <div class=\"form-group row\">\n <label class=\"col-12 col-sm-3 col-form-label text-sm-right\" for=\"keyName\">Key</label>\n <div class=\"col-12 col-sm-8 col-lg-6\">\n <input valtimoFieldAutoFocus type=\"text\" id=\"keyName\" formControlName=\"keyName\" class=\"form-control\" placeholder=\"Choice field key name\"\n [ngClass]=\"{'is-valid': formControls.keyName.touched && formControls.keyName.valid, 'is-invalid': formControls.keyName.touched && formControls.keyName.errors}\"\n required />\n <div *ngIf=\"formControls.keyName.touched && formControls.keyName.errors\" class=\"invalid-feedback\">\n <div *ngIf=\"formControls.keyName.errors.required\">Key name is required</div>\n </div>\n </div>\n </div>\n\n <div class=\"form-group row\">\n <label class=\"col-12 col-sm-3 col-form-label text-sm-right\" for=\"title\">Title</label>\n <div class=\"col-12 col-sm-8 col-lg-6\">\n <input type=\"text\" id=\"title\" formControlName=\"title\" class=\"form-control\" placeholder=\"Choice field title\"\n [ngClass]=\"{'is-valid': formControls.title.touched && formControls.title.valid, 'is-invalid': formControls.title.touched && formControls.title.errors}\"\n required/>\n <div *ngIf=\"formControls.title.touched && formControls.title.errors\" class=\"invalid-feedback\">\n <div *ngIf=\"formControls.title.errors.required\">Title is required</div>\n </div>\n </div>\n </div>\n\n <div class=\"row pt-3 mt-1\">\n <div class=\"col-12 col-sm-6 text-left\">\n <a [routerLink]=\"'/choice-fields'\" class=\"btn btn-space btn-default\">Back</a>\n </div>\n <div class=\"col-12 col-sm-6 text-right\">\n <button class=\"btn btn-space btn-secondary\" type=\"button\" (click)=\"reset()\">Reset</button>\n <button class=\"btn btn-space btn-primary\" type=\"submit\" [disabled]=\"form.invalid\">Submit</button>\n </div>\n </div>\n </form>\n </div>\n </div>\n </valtimo-widget>\n </div>\n </div>\n</div>\n",
321
- styles: [""]
322
- },] }
323
- ];
324
- ChoiceFieldCreateComponent.ctorParameters = function () { return [
325
- { type: router.Router },
326
- { type: forms.FormBuilder },
327
- { type: ChoiceFieldService },
328
- { type: components.AlertService }
272
+ /*
273
+ * Copyright 2015-2020 Ritense BV, the Netherlands.
274
+ *
275
+ * Licensed under EUPL, Version 1.2 (the "License");
276
+ * you may not use this file except in compliance with the License.
277
+ * You may obtain a copy of the License at
278
+ *
279
+ * https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12
280
+ *
281
+ * Unless required by applicable law or agreed to in writing, software
282
+ * distributed under the License is distributed on an "AS IS" basis,
283
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
284
+ * See the License for the specific language governing permissions and
285
+ * limitations under the License.
286
+ */
287
+ var ChoiceFieldCreateComponent = /** @class */ (function () {
288
+ function ChoiceFieldCreateComponent(router, formBuilder, service, alertService) {
289
+ this.router = router;
290
+ this.formBuilder = formBuilder;
291
+ this.service = service;
292
+ this.alertService = alertService;
293
+ }
294
+ ChoiceFieldCreateComponent.prototype.ngOnInit = function () {
295
+ this.reset();
296
+ };
297
+ Object.defineProperty(ChoiceFieldCreateComponent.prototype, "formControls", {
298
+ get: function () {
299
+ return this.form.controls;
300
+ },
301
+ enumerable: false,
302
+ configurable: true
303
+ });
304
+ ChoiceFieldCreateComponent.prototype.createFormGroup = function () {
305
+ return this.formBuilder.group({
306
+ keyName: new forms.FormControl('', forms.Validators.required),
307
+ title: new forms.FormControl('', forms.Validators.required),
308
+ });
309
+ };
310
+ ChoiceFieldCreateComponent.prototype.onSubmit = function () {
311
+ var _this = this;
312
+ this.service.create(this.form.value).subscribe(function (result) {
313
+ _this.router.navigate(["/choice-fields/field/" + result.id]);
314
+ _this.alertService.success('New choice field has been created');
315
+ });
316
+ };
317
+ ChoiceFieldCreateComponent.prototype.reset = function () {
318
+ this.form = this.createFormGroup();
319
+ };
320
+ return ChoiceFieldCreateComponent;
321
+ }());
322
+ ChoiceFieldCreateComponent.decorators = [
323
+ { type: i0.Component, args: [{
324
+ selector: 'valtimo-choice-field-create',
325
+ 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\">\n <div class=\"container-fluid\">\n <div class=\"col-12 px-0 mb-5\">\n <valtimo-widget>\n <div>\n <div class=\"p-5 bg-white\">\n <form [formGroup]=\"form\" (ngSubmit)=\"onSubmit()\">\n <div class=\"form-group row\">\n <label class=\"col-12 col-sm-3 col-form-label text-sm-right\" for=\"keyName\"\n >Key</label\n >\n <div class=\"col-12 col-sm-8 col-lg-6\">\n <input\n valtimoFieldAutoFocus\n type=\"text\"\n id=\"keyName\"\n formControlName=\"keyName\"\n class=\"form-control\"\n placeholder=\"Choice field key name\"\n [ngClass]=\"{\n 'is-valid': formControls.keyName.touched && formControls.keyName.valid,\n 'is-invalid': formControls.keyName.touched && formControls.keyName.errors\n }\"\n required\n />\n <div\n *ngIf=\"formControls.keyName.touched && formControls.keyName.errors\"\n class=\"invalid-feedback\"\n >\n <div *ngIf=\"formControls.keyName.errors.required\">Key name is required</div>\n </div>\n </div>\n </div>\n\n <div class=\"form-group row\">\n <label class=\"col-12 col-sm-3 col-form-label text-sm-right\" for=\"title\"\n >Title</label\n >\n <div class=\"col-12 col-sm-8 col-lg-6\">\n <input\n type=\"text\"\n id=\"title\"\n formControlName=\"title\"\n class=\"form-control\"\n placeholder=\"Choice field title\"\n [ngClass]=\"{\n 'is-valid': formControls.title.touched && formControls.title.valid,\n 'is-invalid': formControls.title.touched && formControls.title.errors\n }\"\n required\n />\n <div\n *ngIf=\"formControls.title.touched && formControls.title.errors\"\n class=\"invalid-feedback\"\n >\n <div *ngIf=\"formControls.title.errors.required\">Title is required</div>\n </div>\n </div>\n </div>\n\n <div class=\"row pt-3 mt-1\">\n <div class=\"col-12 col-sm-6 text-left\">\n <a [routerLink]=\"'/choice-fields'\" class=\"btn btn-space btn-default\">Back</a>\n </div>\n <div class=\"col-12 col-sm-6 text-right\">\n <button class=\"btn btn-space btn-secondary\" type=\"button\" (click)=\"reset()\">\n Reset\n </button>\n <button class=\"btn btn-space btn-primary\" type=\"submit\" [disabled]=\"form.invalid\">\n Submit\n </button>\n </div>\n </div>\n </form>\n </div>\n </div>\n </valtimo-widget>\n </div>\n </div>\n</div>\n",
326
+ styles: [""]
327
+ },] }
328
+ ];
329
+ ChoiceFieldCreateComponent.ctorParameters = function () { return [
330
+ { type: router.Router },
331
+ { type: forms.FormBuilder },
332
+ { type: ChoiceFieldService },
333
+ { type: components.AlertService }
329
334
  ]; };
330
335
 
331
- /*
332
- * Copyright 2015-2020 Ritense BV, the Netherlands.
333
- *
334
- * Licensed under EUPL, Version 1.2 (the "License");
335
- * you may not use this file except in compliance with the License.
336
- * You may obtain a copy of the License at
337
- *
338
- * https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12
339
- *
340
- * Unless required by applicable law or agreed to in writing, software
341
- * distributed under the License is distributed on an "AS IS" basis,
342
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
343
- * See the License for the specific language governing permissions and
344
- * limitations under the License.
345
- */
346
- var ChoiceFieldValueCreateComponent = /** @class */ (function () {
347
- function ChoiceFieldValueCreateComponent(router, route, formBuilder, service, alertService) {
348
- this.router = router;
349
- this.route = route;
350
- this.formBuilder = formBuilder;
351
- this.service = service;
352
- this.alertService = alertService;
353
- var snapshot = this.route.snapshot.paramMap;
354
- this.choiceFieldId = snapshot.get('id');
355
- }
356
- ChoiceFieldValueCreateComponent.prototype.ngOnInit = function () {
357
- this.reset();
358
- };
359
- Object.defineProperty(ChoiceFieldValueCreateComponent.prototype, "formControls", {
360
- get: function () {
361
- return this.form.controls;
362
- },
363
- enumerable: false,
364
- configurable: true
365
- });
366
- ChoiceFieldValueCreateComponent.prototype.createFormGroup = function () {
367
- return this.formBuilder.group({
368
- name: new forms.FormControl('', forms.Validators.required),
369
- value: new forms.FormControl('', forms.Validators.required),
370
- sortOrder: new forms.FormControl('', forms.Validators.required),
371
- deprecated: new forms.FormControl('', forms.Validators.required)
372
- });
373
- };
374
- ChoiceFieldValueCreateComponent.prototype.initData = function (id) {
375
- var _this = this;
376
- this.service.get(id).subscribe(function (result) {
377
- _this.choiceField = result;
378
- _this.setValues();
379
- });
380
- };
381
- ChoiceFieldValueCreateComponent.prototype.setValues = function () {
382
- if (this.choiceField) {
383
- // set form values default false
384
- this.form.controls.deprecated.setValue(false);
385
- }
386
- };
387
- ChoiceFieldValueCreateComponent.prototype.onSubmit = function () {
388
- var _this = this;
389
- this.service.createValue(this.form.value, this.choiceField.keyName).subscribe(function (result) {
390
- _this.router.navigate(["/choice-fields/field/" + encodeURI(_this.choiceFieldId)]);
391
- _this.alertService.success('New choice field value has been created');
392
- });
393
- };
394
- ChoiceFieldValueCreateComponent.prototype.reset = function () {
395
- this.form = this.createFormGroup();
396
- this.initData(this.choiceFieldId);
397
- };
398
- return ChoiceFieldValueCreateComponent;
399
- }());
400
- ChoiceFieldValueCreateComponent.decorators = [
401
- { type: i0.Component, args: [{
402
- selector: 'valtimo-choice-field-value-create',
403
- 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\">\n <div class=\"container-fluid\">\n <div class=\"col-12 px-0 mb-5\">\n <valtimo-widget *ngIf=\"choiceField\">\n <div>\n <div class=\"card-body bg-light\">\n <div class=\"row py-5\">\n <div class=\"col-12\">\n <div class=\"row mb-3\">\n <div class=\"col-12\">\n <strong>Choice field</strong>\n <hr />\n </div>\n </div>\n <div class=\"row mb-3\">\n <div class=\"col-12 col-sm-3 text-sm-right\"><strong>ID</strong></div>\n <div class=\"col-12 col-sm-8 col-lg-6\">{{ choiceField.id }}</div>\n </div>\n <div class=\"row mb-3\">\n <div class=\"col-12 col-sm-3 text-sm-right\"><strong>Key</strong></div>\n <div class=\"col-12 col-sm-8 col-lg-6\">{{ choiceField.keyName }}</div>\n </div>\n <div class=\"row\">\n <div class=\"col-12 col-sm-3 text-sm-right\"><strong>Title</strong></div>\n <div class=\"col-12 col-sm-8 col-lg-6\">{{ choiceField.title }}</div>\n </div>\n </div>\n </div>\n </div>\n\n <div class=\"bg-white p-5\">\n <form [formGroup]=\"form\" (ngSubmit)=\"onSubmit()\">\n <div class=\"form-group row\">\n <label class=\"col-12 col-sm-3 col-form-label text-sm-right\" for=\"name\">Key</label>\n <div class=\"col-12 col-sm-8 col-lg-6\">\n <input valtimoFieldAutoFocus type=\"text\" id=\"name\" formControlName=\"name\" class=\"form-control\" placeholder=\"Choice field value key\"\n [ngClass]=\"{'is-valid': formControls.name.touched && formControls.name.valid, 'is-invalid': formControls.name.touched && formControls.name.errors}\"\n required/>\n <div *ngIf=\"formControls.name.touched && formControls.name.errors\" class=\"invalid-feedback\">\n <div *ngIf=\"formControls.name.errors.required\">Choice field value key is required</div>\n </div>\n </div>\n </div>\n\n <div class=\"form-group row\">\n <label class=\"col-12 col-sm-3 col-form-label text-sm-right\" for=\"value\">Value</label>\n <div class=\"col-12 col-sm-8 col-lg-6\">\n <input type=\"text\" id=\"value\" formControlName=\"value\" class=\"form-control\" placeholder=\"Choice field value\"\n [ngClass]=\"{'is-valid': formControls.value.touched && formControls.value.valid, 'is-invalid': formControls.value.touched && formControls.value.errors}\"\n required/>\n <div *ngIf=\"formControls.value.touched && formControls.value.errors\" class=\"invalid-feedback\">\n <div *ngIf=\"formControls.value.errors.required\">Choice field value is required</div>\n </div>\n </div>\n </div>\n\n <div class=\"form-group row\">\n <label class=\"col-12 col-sm-3 col-form-label text-sm-right\" for=\"sortOrder\">Sequence</label>\n <div class=\"col-12 col-sm-8 col-lg-6\">\n <input type=\"number\" id=\"sortOrder\" formControlName=\"sortOrder\" class=\"form-control\" placeholder=\"Choice field value sequence\"\n [ngClass]=\"{'is-valid': formControls.sortOrder.touched && formControls.sortOrder.valid, 'is-invalid': formControls.sortOrder.touched && formControls.sortOrder.errors}\"\n required/>\n <div *ngIf=\"formControls.sortOrder.touched && formControls.sortOrder.errors\" class=\"invalid-feedback\">\n <div *ngIf=\"formControls.sortOrder.errors.required\">Choice field value sequence is required</div>\n </div>\n </div>\n </div>\n\n <div class=\"form-group row\">\n <label class=\"col-12 col-sm-3 col-form-label text-sm-right\" for=\"deprecated\">Deprecated</label>\n <div class=\"col-12 col-sm-8 col-lg-6\">\n <div class=\"switch-button switch-button-sm switch-button-success\">\n <input type=\"checkbox\" formControlName=\"deprecated\" id=\"deprecated\"><span>\n <label for=\"deprecated\"></label></span>\n </div>\n </div>\n </div>\n\n <div class=\"row pt-3 mt-1\">\n <div class=\"col-12 col-sm-6 text-left\">\n <a [routerLink]=\"'../'\" class=\"btn btn-space btn-default\">Back</a>\n </div>\n <div class=\"col-12 col-sm-6 text-right\">\n <button class=\"btn btn-space btn-secondary\" type=\"button\" (click)=\"reset()\">Reset</button>\n <button class=\"btn btn-space btn-primary\" type=\"submit\" [disabled]=\"form.invalid\">Submit</button>\n </div>\n </div>\n </form>\n </div>\n </div>\n </valtimo-widget>\n </div>\n </div>\n</div>\n",
404
- styles: [""]
405
- },] }
406
- ];
407
- ChoiceFieldValueCreateComponent.ctorParameters = function () { return [
408
- { type: router.Router },
409
- { type: router.ActivatedRoute },
410
- { type: forms.FormBuilder },
411
- { type: ChoiceFieldService },
412
- { type: components.AlertService }
336
+ /*
337
+ * Copyright 2015-2020 Ritense BV, the Netherlands.
338
+ *
339
+ * Licensed under EUPL, Version 1.2 (the "License");
340
+ * you may not use this file except in compliance with the License.
341
+ * You may obtain a copy of the License at
342
+ *
343
+ * https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12
344
+ *
345
+ * Unless required by applicable law or agreed to in writing, software
346
+ * distributed under the License is distributed on an "AS IS" basis,
347
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
348
+ * See the License for the specific language governing permissions and
349
+ * limitations under the License.
350
+ */
351
+ var ChoiceFieldValueCreateComponent = /** @class */ (function () {
352
+ function ChoiceFieldValueCreateComponent(router, route, formBuilder, service, alertService) {
353
+ this.router = router;
354
+ this.route = route;
355
+ this.formBuilder = formBuilder;
356
+ this.service = service;
357
+ this.alertService = alertService;
358
+ var snapshot = this.route.snapshot.paramMap;
359
+ this.choiceFieldId = snapshot.get('id');
360
+ }
361
+ ChoiceFieldValueCreateComponent.prototype.ngOnInit = function () {
362
+ this.reset();
363
+ };
364
+ Object.defineProperty(ChoiceFieldValueCreateComponent.prototype, "formControls", {
365
+ get: function () {
366
+ return this.form.controls;
367
+ },
368
+ enumerable: false,
369
+ configurable: true
370
+ });
371
+ ChoiceFieldValueCreateComponent.prototype.createFormGroup = function () {
372
+ return this.formBuilder.group({
373
+ name: new forms.FormControl('', forms.Validators.required),
374
+ value: new forms.FormControl('', forms.Validators.required),
375
+ sortOrder: new forms.FormControl('', forms.Validators.required),
376
+ deprecated: new forms.FormControl('', forms.Validators.required),
377
+ });
378
+ };
379
+ ChoiceFieldValueCreateComponent.prototype.initData = function (id) {
380
+ var _this = this;
381
+ this.service.get(id).subscribe(function (result) {
382
+ _this.choiceField = result;
383
+ _this.setValues();
384
+ });
385
+ };
386
+ ChoiceFieldValueCreateComponent.prototype.setValues = function () {
387
+ if (this.choiceField) {
388
+ // set form values default false
389
+ this.form.controls.deprecated.setValue(false);
390
+ }
391
+ };
392
+ ChoiceFieldValueCreateComponent.prototype.onSubmit = function () {
393
+ var _this = this;
394
+ this.service.createValue(this.form.value, this.choiceField.keyName).subscribe(function (result) {
395
+ _this.router.navigate(["/choice-fields/field/" + encodeURI(_this.choiceFieldId)]);
396
+ _this.alertService.success('New choice field value has been created');
397
+ });
398
+ };
399
+ ChoiceFieldValueCreateComponent.prototype.reset = function () {
400
+ this.form = this.createFormGroup();
401
+ this.initData(this.choiceFieldId);
402
+ };
403
+ return ChoiceFieldValueCreateComponent;
404
+ }());
405
+ ChoiceFieldValueCreateComponent.decorators = [
406
+ { type: i0.Component, args: [{
407
+ selector: 'valtimo-choice-field-value-create',
408
+ 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\">\n <div class=\"container-fluid\">\n <div class=\"col-12 px-0 mb-5\">\n <valtimo-widget *ngIf=\"choiceField\">\n <div>\n <div class=\"card-body bg-light\">\n <div class=\"row py-5\">\n <div class=\"col-12\">\n <div class=\"row mb-3\">\n <div class=\"col-12\">\n <strong>Choice field</strong>\n <hr />\n </div>\n </div>\n <div class=\"row mb-3\">\n <div class=\"col-12 col-sm-3 text-sm-right\"><strong>ID</strong></div>\n <div class=\"col-12 col-sm-8 col-lg-6\">{{ choiceField.id }}</div>\n </div>\n <div class=\"row mb-3\">\n <div class=\"col-12 col-sm-3 text-sm-right\"><strong>Key</strong></div>\n <div class=\"col-12 col-sm-8 col-lg-6\">{{ choiceField.keyName }}</div>\n </div>\n <div class=\"row\">\n <div class=\"col-12 col-sm-3 text-sm-right\"><strong>Title</strong></div>\n <div class=\"col-12 col-sm-8 col-lg-6\">{{ choiceField.title }}</div>\n </div>\n </div>\n </div>\n </div>\n\n <div class=\"bg-white p-5\">\n <form [formGroup]=\"form\" (ngSubmit)=\"onSubmit()\">\n <div class=\"form-group row\">\n <label class=\"col-12 col-sm-3 col-form-label text-sm-right\" for=\"name\">Key</label>\n <div class=\"col-12 col-sm-8 col-lg-6\">\n <input\n valtimoFieldAutoFocus\n type=\"text\"\n id=\"name\"\n formControlName=\"name\"\n class=\"form-control\"\n placeholder=\"Choice field value key\"\n [ngClass]=\"{\n 'is-valid': formControls.name.touched && formControls.name.valid,\n 'is-invalid': formControls.name.touched && formControls.name.errors\n }\"\n required\n />\n <div\n *ngIf=\"formControls.name.touched && formControls.name.errors\"\n class=\"invalid-feedback\"\n >\n <div *ngIf=\"formControls.name.errors.required\">\n Choice field value key is required\n </div>\n </div>\n </div>\n </div>\n\n <div class=\"form-group row\">\n <label class=\"col-12 col-sm-3 col-form-label text-sm-right\" for=\"value\"\n >Value</label\n >\n <div class=\"col-12 col-sm-8 col-lg-6\">\n <input\n type=\"text\"\n id=\"value\"\n formControlName=\"value\"\n class=\"form-control\"\n placeholder=\"Choice field value\"\n [ngClass]=\"{\n 'is-valid': formControls.value.touched && formControls.value.valid,\n 'is-invalid': formControls.value.touched && formControls.value.errors\n }\"\n required\n />\n <div\n *ngIf=\"formControls.value.touched && formControls.value.errors\"\n class=\"invalid-feedback\"\n >\n <div *ngIf=\"formControls.value.errors.required\">\n Choice field value is required\n </div>\n </div>\n </div>\n </div>\n\n <div class=\"form-group row\">\n <label class=\"col-12 col-sm-3 col-form-label text-sm-right\" for=\"sortOrder\"\n >Sequence</label\n >\n <div class=\"col-12 col-sm-8 col-lg-6\">\n <input\n type=\"number\"\n id=\"sortOrder\"\n formControlName=\"sortOrder\"\n class=\"form-control\"\n placeholder=\"Choice field value sequence\"\n [ngClass]=\"{\n 'is-valid': formControls.sortOrder.touched && formControls.sortOrder.valid,\n 'is-invalid': formControls.sortOrder.touched && formControls.sortOrder.errors\n }\"\n required\n />\n <div\n *ngIf=\"formControls.sortOrder.touched && formControls.sortOrder.errors\"\n class=\"invalid-feedback\"\n >\n <div *ngIf=\"formControls.sortOrder.errors.required\">\n Choice field value sequence is required\n </div>\n </div>\n </div>\n </div>\n\n <div class=\"form-group row\">\n <label class=\"col-12 col-sm-3 col-form-label text-sm-right\" for=\"deprecated\"\n >Deprecated</label\n >\n <div class=\"col-12 col-sm-8 col-lg-6\">\n <div class=\"switch-button switch-button-sm switch-button-success\">\n <input type=\"checkbox\" formControlName=\"deprecated\" id=\"deprecated\" /><span>\n <label for=\"deprecated\"></label\n ></span>\n </div>\n </div>\n </div>\n\n <div class=\"row pt-3 mt-1\">\n <div class=\"col-12 col-sm-6 text-left\">\n <a [routerLink]=\"'../'\" class=\"btn btn-space btn-default\">Back</a>\n </div>\n <div class=\"col-12 col-sm-6 text-right\">\n <button class=\"btn btn-space btn-secondary\" type=\"button\" (click)=\"reset()\">\n Reset\n </button>\n <button class=\"btn btn-space btn-primary\" type=\"submit\" [disabled]=\"form.invalid\">\n Submit\n </button>\n </div>\n </div>\n </form>\n </div>\n </div>\n </valtimo-widget>\n </div>\n </div>\n</div>\n",
409
+ styles: [""]
410
+ },] }
411
+ ];
412
+ ChoiceFieldValueCreateComponent.ctorParameters = function () { return [
413
+ { type: router.Router },
414
+ { type: router.ActivatedRoute },
415
+ { type: forms.FormBuilder },
416
+ { type: ChoiceFieldService },
417
+ { type: components.AlertService }
413
418
  ]; };
414
419
 
415
- /*
416
- * Copyright 2015-2020 Ritense BV, the Netherlands.
417
- *
418
- * Licensed under EUPL, Version 1.2 (the "License");
419
- * you may not use this file except in compliance with the License.
420
- * You may obtain a copy of the License at
421
- *
422
- * https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12
423
- *
424
- * Unless required by applicable law or agreed to in writing, software
425
- * distributed under the License is distributed on an "AS IS" basis,
426
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
427
- * See the License for the specific language governing permissions and
428
- * limitations under the License.
429
- */
430
- var ChoiceFieldValueDetailComponent = /** @class */ (function () {
431
- function ChoiceFieldValueDetailComponent(router, route, formBuilder, service, alertService) {
432
- this.router = router;
433
- this.route = route;
434
- this.formBuilder = formBuilder;
435
- this.service = service;
436
- this.alertService = alertService;
437
- var snapshot = this.route.snapshot.paramMap;
438
- this.choiceFieldValueId = snapshot.get('valueId');
439
- }
440
- ChoiceFieldValueDetailComponent.prototype.ngOnInit = function () {
441
- this.reset();
442
- };
443
- Object.defineProperty(ChoiceFieldValueDetailComponent.prototype, "formControls", {
444
- get: function () {
445
- return this.form.controls;
446
- },
447
- enumerable: false,
448
- configurable: true
449
- });
450
- ChoiceFieldValueDetailComponent.prototype.initData = function (choiceFieldValueId) {
451
- var _this = this;
452
- this.service.getValue(choiceFieldValueId).subscribe(function (result) {
453
- _this.choiceField = result.choiceField;
454
- _this.choiceFieldValue = result;
455
- _this.setValues();
456
- });
457
- };
458
- ChoiceFieldValueDetailComponent.prototype.createFormGroup = function () {
459
- return this.formBuilder.group({
460
- id: new forms.FormControl('', forms.Validators.required),
461
- name: new forms.FormControl('', forms.Validators.required),
462
- value: new forms.FormControl('', forms.Validators.required),
463
- sortOrder: new forms.FormControl('', forms.Validators.required),
464
- deprecated: new forms.FormControl('', forms.Validators.required)
465
- });
466
- };
467
- ChoiceFieldValueDetailComponent.prototype.setValues = function () {
468
- if (this.choiceField) {
469
- // set form values
470
- this.form.controls.id.setValue(this.choiceFieldValue.id);
471
- this.form.controls.name.setValue(this.choiceFieldValue.name);
472
- this.form.controls.value.setValue(this.choiceFieldValue.value);
473
- this.form.controls.sortOrder.setValue(this.choiceFieldValue.sortOrder);
474
- this.form.controls.deprecated.setValue(this.choiceFieldValue.deprecated);
475
- }
476
- };
477
- ChoiceFieldValueDetailComponent.prototype.reset = function () {
478
- this.form = this.createFormGroup();
479
- this.initData(this.choiceFieldValueId);
480
- };
481
- ChoiceFieldValueDetailComponent.prototype.onSubmit = function () {
482
- var _this = this;
483
- this.service.updateValue(this.form.value, this.choiceField.keyName).subscribe(function () {
484
- _this.reset();
485
- _this.alertService.success('Choice field value details have been updated');
486
- });
487
- };
488
- return ChoiceFieldValueDetailComponent;
489
- }());
490
- ChoiceFieldValueDetailComponent.decorators = [
491
- { type: i0.Component, args: [{
492
- selector: 'valtimo-choice-field-value-detail',
493
- 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\">\n <div class=\"container-fluid\">\n <div class=\"col-12 px-0 mb-5\">\n <valtimo-widget *ngIf=\"choiceField\">\n <div>\n <div class=\"card-body bg-light\">\n <div class=\"row py-5\">\n <div class=\"col-12\">\n <div class=\"row mb-3\">\n <div class=\"col-12\">\n <strong>Choice field</strong>\n <hr />\n </div>\n </div>\n <div class=\"row mb-3\">\n <div class=\"col-12 col-sm-3 text-sm-right\"><strong>ID</strong></div>\n <div class=\"col-12 col-sm-8 col-lg-6\">{{ choiceField.id }}</div>\n </div>\n <div class=\"row mb-3\">\n <div class=\"col-12 col-sm-3 text-sm-right\"><strong>Key</strong></div>\n <div class=\"col-12 col-sm-8 col-lg-6\">{{ choiceField.keyName }}</div>\n </div>\n <div class=\"row mb-3\">\n <div class=\"col-12 col-sm-3 text-sm-right\"><strong>Title</strong></div>\n <div class=\"col-12 col-sm-8 col-lg-6\">{{ choiceField.title }}</div>\n </div>\n <div class=\"row mb-3\">\n <div class=\"col-12 pt-3\">\n <strong>Choice field value</strong>\n <hr />\n </div>\n </div>\n <div class=\"row\">\n <div class=\"col-12 col-sm-3 text-sm-right\"><strong>ID</strong></div>\n <div class=\"col-12 col-sm-8 col-lg-6\">{{ choiceFieldValue.id }}</div>\n </div>\n </div>\n </div>\n </div>\n\n <div class=\"bg-white p-5\">\n <form [formGroup]=\"form\" (ngSubmit)=\"onSubmit()\">\n <div class=\"form-group row\">\n <label class=\"col-12 col-sm-3 col-form-label text-sm-right\" for=\"name\">Key</label>\n <div class=\"col-12 col-sm-8 col-lg-6\">\n <input valtimoFieldAutoFocus type=\"text\" id=\"name\" formControlName=\"name\" class=\"form-control\" placeholder=\"Choice field value key\"\n [ngClass]=\"{'is-valid': formControls.name.touched && formControls.name.valid, 'is-invalid': formControls.name.touched && formControls.name.errors}\"\n required/>\n <div *ngIf=\"formControls.name.touched && formControls.name.errors\" class=\"invalid-feedback\">\n <div *ngIf=\"formControls.name.errors.required\">Choice field value key is required</div>\n </div>\n </div>\n </div>\n\n <div class=\"form-group row\">\n <label class=\"col-12 col-sm-3 col-form-label text-sm-right\" for=\"value\">Value</label>\n <div class=\"col-12 col-sm-8 col-lg-6\">\n <input type=\"text\" id=\"value\" formControlName=\"value\" class=\"form-control\" placeholder=\"Choice field value\"\n [ngClass]=\"{'is-valid': formControls.value.touched && formControls.value.valid, 'is-invalid': formControls.value.touched && formControls.value.errors}\"\n required/>\n <div *ngIf=\"formControls.value.touched && formControls.value.errors\" class=\"invalid-feedback\">\n <div *ngIf=\"formControls.value.errors.required\">Choice field value is required</div>\n </div>\n </div>\n </div>\n\n <div class=\"form-group row\">\n <label class=\"col-12 col-sm-3 col-form-label text-sm-right\" for=\"sortOrder\">Sequence</label>\n <div class=\"col-12 col-sm-8 col-lg-6\">\n <input type=\"number\" id=\"sortOrder\" formControlName=\"sortOrder\" class=\"form-control\" placeholder=\"Choice field value sequence\"\n [ngClass]=\"{'is-valid': formControls.sortOrder.touched && formControls.sortOrder.valid, 'is-invalid': formControls.sortOrder.touched && formControls.sortOrder.errors}\"\n required/>\n <div *ngIf=\"formControls.sortOrder.touched && formControls.sortOrder.errors\" class=\"invalid-feedback\">\n <div *ngIf=\"formControls.sortOrder.errors.required\">Choice field value sequence is required</div>\n </div>\n </div>\n </div>\n\n <div class=\"form-group row\">\n <label class=\"col-12 col-sm-3 col-form-label text-sm-right\" for=\"deprecated\">Deprecated</label>\n <div class=\"col-12 col-sm-8 col-lg-6\">\n <div class=\"switch-button switch-button-sm switch-button-success\">\n <input type=\"checkbox\" formControlName=\"deprecated\" id=\"deprecated\"><span>\n <label for=\"deprecated\"></label></span>\n </div>\n </div>\n </div>\n\n <div class=\"row pt-3 mt-1\">\n <div class=\"col-12 col-sm-6 text-left\">\n <a [routerLink]=\"'../../'\" class=\"btn btn-space btn-default\">Back</a>\n </div>\n <div class=\"col-12 col-sm-6 text-right\">\n <button class=\"btn btn-space btn-secondary\" type=\"button\" (click)=\"reset()\">Reset</button>\n <button class=\"btn btn-space btn-primary\" type=\"submit\" [disabled]=\"form.invalid\">Submit</button>\n </div>\n </div>\n </form>\n </div>\n </div>\n </valtimo-widget>\n </div>\n </div>\n</div>\n",
494
- styles: [""]
495
- },] }
496
- ];
497
- ChoiceFieldValueDetailComponent.ctorParameters = function () { return [
498
- { type: router.Router },
499
- { type: router.ActivatedRoute },
500
- { type: forms.FormBuilder },
501
- { type: ChoiceFieldService },
502
- { type: components.AlertService }
420
+ /*
421
+ * Copyright 2015-2020 Ritense BV, the Netherlands.
422
+ *
423
+ * Licensed under EUPL, Version 1.2 (the "License");
424
+ * you may not use this file except in compliance with the License.
425
+ * You may obtain a copy of the License at
426
+ *
427
+ * https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12
428
+ *
429
+ * Unless required by applicable law or agreed to in writing, software
430
+ * distributed under the License is distributed on an "AS IS" basis,
431
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
432
+ * See the License for the specific language governing permissions and
433
+ * limitations under the License.
434
+ */
435
+ var ChoiceFieldValueDetailComponent = /** @class */ (function () {
436
+ function ChoiceFieldValueDetailComponent(router, route, formBuilder, service, alertService) {
437
+ this.router = router;
438
+ this.route = route;
439
+ this.formBuilder = formBuilder;
440
+ this.service = service;
441
+ this.alertService = alertService;
442
+ var snapshot = this.route.snapshot.paramMap;
443
+ this.choiceFieldValueId = snapshot.get('valueId');
444
+ }
445
+ ChoiceFieldValueDetailComponent.prototype.ngOnInit = function () {
446
+ this.reset();
447
+ };
448
+ Object.defineProperty(ChoiceFieldValueDetailComponent.prototype, "formControls", {
449
+ get: function () {
450
+ return this.form.controls;
451
+ },
452
+ enumerable: false,
453
+ configurable: true
454
+ });
455
+ ChoiceFieldValueDetailComponent.prototype.initData = function (choiceFieldValueId) {
456
+ var _this = this;
457
+ this.service.getValue(choiceFieldValueId).subscribe(function (result) {
458
+ _this.choiceField = result.choiceField;
459
+ _this.choiceFieldValue = result;
460
+ _this.setValues();
461
+ });
462
+ };
463
+ ChoiceFieldValueDetailComponent.prototype.createFormGroup = function () {
464
+ return this.formBuilder.group({
465
+ id: new forms.FormControl('', forms.Validators.required),
466
+ name: new forms.FormControl('', forms.Validators.required),
467
+ value: new forms.FormControl('', forms.Validators.required),
468
+ sortOrder: new forms.FormControl('', forms.Validators.required),
469
+ deprecated: new forms.FormControl('', forms.Validators.required),
470
+ });
471
+ };
472
+ ChoiceFieldValueDetailComponent.prototype.setValues = function () {
473
+ if (this.choiceField) {
474
+ // set form values
475
+ this.form.controls.id.setValue(this.choiceFieldValue.id);
476
+ this.form.controls.name.setValue(this.choiceFieldValue.name);
477
+ this.form.controls.value.setValue(this.choiceFieldValue.value);
478
+ this.form.controls.sortOrder.setValue(this.choiceFieldValue.sortOrder);
479
+ this.form.controls.deprecated.setValue(this.choiceFieldValue.deprecated);
480
+ }
481
+ };
482
+ ChoiceFieldValueDetailComponent.prototype.reset = function () {
483
+ this.form = this.createFormGroup();
484
+ this.initData(this.choiceFieldValueId);
485
+ };
486
+ ChoiceFieldValueDetailComponent.prototype.onSubmit = function () {
487
+ var _this = this;
488
+ this.service.updateValue(this.form.value, this.choiceField.keyName).subscribe(function () {
489
+ _this.reset();
490
+ _this.alertService.success('Choice field value details have been updated');
491
+ });
492
+ };
493
+ return ChoiceFieldValueDetailComponent;
494
+ }());
495
+ ChoiceFieldValueDetailComponent.decorators = [
496
+ { type: i0.Component, args: [{
497
+ selector: 'valtimo-choice-field-value-detail',
498
+ 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\">\n <div class=\"container-fluid\">\n <div class=\"col-12 px-0 mb-5\">\n <valtimo-widget *ngIf=\"choiceField\">\n <div>\n <div class=\"card-body bg-light\">\n <div class=\"row py-5\">\n <div class=\"col-12\">\n <div class=\"row mb-3\">\n <div class=\"col-12\">\n <strong>Choice field</strong>\n <hr />\n </div>\n </div>\n <div class=\"row mb-3\">\n <div class=\"col-12 col-sm-3 text-sm-right\"><strong>ID</strong></div>\n <div class=\"col-12 col-sm-8 col-lg-6\">{{ choiceField.id }}</div>\n </div>\n <div class=\"row mb-3\">\n <div class=\"col-12 col-sm-3 text-sm-right\"><strong>Key</strong></div>\n <div class=\"col-12 col-sm-8 col-lg-6\">{{ choiceField.keyName }}</div>\n </div>\n <div class=\"row mb-3\">\n <div class=\"col-12 col-sm-3 text-sm-right\"><strong>Title</strong></div>\n <div class=\"col-12 col-sm-8 col-lg-6\">{{ choiceField.title }}</div>\n </div>\n <div class=\"row mb-3\">\n <div class=\"col-12 pt-3\">\n <strong>Choice field value</strong>\n <hr />\n </div>\n </div>\n <div class=\"row\">\n <div class=\"col-12 col-sm-3 text-sm-right\"><strong>ID</strong></div>\n <div class=\"col-12 col-sm-8 col-lg-6\">{{ choiceFieldValue.id }}</div>\n </div>\n </div>\n </div>\n </div>\n\n <div class=\"bg-white p-5\">\n <form [formGroup]=\"form\" (ngSubmit)=\"onSubmit()\">\n <div class=\"form-group row\">\n <label class=\"col-12 col-sm-3 col-form-label text-sm-right\" for=\"name\">Key</label>\n <div class=\"col-12 col-sm-8 col-lg-6\">\n <input\n valtimoFieldAutoFocus\n type=\"text\"\n id=\"name\"\n formControlName=\"name\"\n class=\"form-control\"\n placeholder=\"Choice field value key\"\n [ngClass]=\"{\n 'is-valid': formControls.name.touched && formControls.name.valid,\n 'is-invalid': formControls.name.touched && formControls.name.errors\n }\"\n required\n />\n <div\n *ngIf=\"formControls.name.touched && formControls.name.errors\"\n class=\"invalid-feedback\"\n >\n <div *ngIf=\"formControls.name.errors.required\">\n Choice field value key is required\n </div>\n </div>\n </div>\n </div>\n\n <div class=\"form-group row\">\n <label class=\"col-12 col-sm-3 col-form-label text-sm-right\" for=\"value\"\n >Value</label\n >\n <div class=\"col-12 col-sm-8 col-lg-6\">\n <input\n type=\"text\"\n id=\"value\"\n formControlName=\"value\"\n class=\"form-control\"\n placeholder=\"Choice field value\"\n [ngClass]=\"{\n 'is-valid': formControls.value.touched && formControls.value.valid,\n 'is-invalid': formControls.value.touched && formControls.value.errors\n }\"\n required\n />\n <div\n *ngIf=\"formControls.value.touched && formControls.value.errors\"\n class=\"invalid-feedback\"\n >\n <div *ngIf=\"formControls.value.errors.required\">\n Choice field value is required\n </div>\n </div>\n </div>\n </div>\n\n <div class=\"form-group row\">\n <label class=\"col-12 col-sm-3 col-form-label text-sm-right\" for=\"sortOrder\"\n >Sequence</label\n >\n <div class=\"col-12 col-sm-8 col-lg-6\">\n <input\n type=\"number\"\n id=\"sortOrder\"\n formControlName=\"sortOrder\"\n class=\"form-control\"\n placeholder=\"Choice field value sequence\"\n [ngClass]=\"{\n 'is-valid': formControls.sortOrder.touched && formControls.sortOrder.valid,\n 'is-invalid': formControls.sortOrder.touched && formControls.sortOrder.errors\n }\"\n required\n />\n <div\n *ngIf=\"formControls.sortOrder.touched && formControls.sortOrder.errors\"\n class=\"invalid-feedback\"\n >\n <div *ngIf=\"formControls.sortOrder.errors.required\">\n Choice field value sequence is required\n </div>\n </div>\n </div>\n </div>\n\n <div class=\"form-group row\">\n <label class=\"col-12 col-sm-3 col-form-label text-sm-right\" for=\"deprecated\"\n >Deprecated</label\n >\n <div class=\"col-12 col-sm-8 col-lg-6\">\n <div class=\"switch-button switch-button-sm switch-button-success\">\n <input type=\"checkbox\" formControlName=\"deprecated\" id=\"deprecated\" /><span>\n <label for=\"deprecated\"></label\n ></span>\n </div>\n </div>\n </div>\n\n <div class=\"row pt-3 mt-1\">\n <div class=\"col-12 col-sm-6 text-left\">\n <a [routerLink]=\"'../../'\" class=\"btn btn-space btn-default\">Back</a>\n </div>\n <div class=\"col-12 col-sm-6 text-right\">\n <button class=\"btn btn-space btn-secondary\" type=\"button\" (click)=\"reset()\">\n Reset\n </button>\n <button class=\"btn btn-space btn-primary\" type=\"submit\" [disabled]=\"form.invalid\">\n Submit\n </button>\n </div>\n </div>\n </form>\n </div>\n </div>\n </valtimo-widget>\n </div>\n </div>\n</div>\n",
499
+ styles: [""]
500
+ },] }
501
+ ];
502
+ ChoiceFieldValueDetailComponent.ctorParameters = function () { return [
503
+ { type: router.Router },
504
+ { type: router.ActivatedRoute },
505
+ { type: forms.FormBuilder },
506
+ { type: ChoiceFieldService },
507
+ { type: components.AlertService }
503
508
  ]; };
504
509
 
505
- /*
506
- * Copyright 2015-2020 Ritense BV, the Netherlands.
507
- *
508
- * Licensed under EUPL, Version 1.2 (the "License");
509
- * you may not use this file except in compliance with the License.
510
- * You may obtain a copy of the License at
511
- *
512
- * https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12
513
- *
514
- * Unless required by applicable law or agreed to in writing, software
515
- * distributed under the License is distributed on an "AS IS" basis,
516
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
517
- * See the License for the specific language governing permissions and
518
- * limitations under the License.
519
- */
520
- var ɵ0 = {
521
- title: 'Choice fields',
522
- roles: [contract.ROLE_ADMIN]
523
- }, ɵ1 = {
524
- title: 'Choice field details',
525
- roles: [contract.ROLE_ADMIN]
526
- }, ɵ2 = {
527
- title: 'Create new Choice field',
528
- roles: [contract.ROLE_ADMIN]
529
- }, ɵ3 = {
530
- title: 'Create new Choice field value',
531
- roles: [contract.ROLE_ADMIN]
532
- }, ɵ4 = {
533
- title: 'Choice field value details',
534
- roles: [contract.ROLE_ADMIN]
535
- };
536
- var routes = [
537
- {
538
- path: 'choice-fields',
539
- data: ɵ0,
540
- component: ChoiceFieldListComponent,
541
- canActivate: [security.AuthGuardService]
542
- },
543
- {
544
- path: 'choice-fields/field/:id',
545
- data: ɵ1,
546
- component: ChoiceFieldDetailComponent,
547
- canActivate: [security.AuthGuardService]
548
- },
549
- {
550
- path: 'choice-fields/create',
551
- data: ɵ2,
552
- component: ChoiceFieldCreateComponent,
553
- canActivate: [security.AuthGuardService]
554
- },
555
- {
556
- path: 'choice-fields/field/:id/create-value',
557
- data: ɵ3,
558
- component: ChoiceFieldValueCreateComponent,
559
- canActivate: [security.AuthGuardService]
560
- },
561
- {
562
- path: 'choice-fields/field/:id/value/:valueId',
563
- data: ɵ4,
564
- component: ChoiceFieldValueDetailComponent,
565
- canActivate: [security.AuthGuardService]
566
- }
567
- ];
568
- var ChoiceFieldRoutingModule = /** @class */ (function () {
569
- function ChoiceFieldRoutingModule() {
570
- }
571
- return ChoiceFieldRoutingModule;
572
- }());
573
- ChoiceFieldRoutingModule.decorators = [
574
- { type: i0.NgModule, args: [{
575
- imports: [
576
- common.CommonModule,
577
- router.RouterModule.forChild(routes),
578
- ],
579
- exports: [router.RouterModule]
580
- },] }
510
+ /*
511
+ * Copyright 2015-2020 Ritense BV, the Netherlands.
512
+ *
513
+ * Licensed under EUPL, Version 1.2 (the "License");
514
+ * you may not use this file except in compliance with the License.
515
+ * You may obtain a copy of the License at
516
+ *
517
+ * https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12
518
+ *
519
+ * Unless required by applicable law or agreed to in writing, software
520
+ * distributed under the License is distributed on an "AS IS" basis,
521
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
522
+ * See the License for the specific language governing permissions and
523
+ * limitations under the License.
524
+ */
525
+ var ɵ0 = {
526
+ title: 'Choice fields',
527
+ roles: [contract.ROLE_ADMIN],
528
+ }, ɵ1 = {
529
+ title: 'Choice field details',
530
+ roles: [contract.ROLE_ADMIN],
531
+ }, ɵ2 = {
532
+ title: 'Create new Choice field',
533
+ roles: [contract.ROLE_ADMIN],
534
+ }, ɵ3 = {
535
+ title: 'Create new Choice field value',
536
+ roles: [contract.ROLE_ADMIN],
537
+ }, ɵ4 = {
538
+ title: 'Choice field value details',
539
+ roles: [contract.ROLE_ADMIN],
540
+ };
541
+ var routes = [
542
+ {
543
+ path: 'choice-fields',
544
+ data: ɵ0,
545
+ component: ChoiceFieldListComponent,
546
+ canActivate: [security.AuthGuardService],
547
+ },
548
+ {
549
+ path: 'choice-fields/field/:id',
550
+ data: ɵ1,
551
+ component: ChoiceFieldDetailComponent,
552
+ canActivate: [security.AuthGuardService],
553
+ },
554
+ {
555
+ path: 'choice-fields/create',
556
+ data: ɵ2,
557
+ component: ChoiceFieldCreateComponent,
558
+ canActivate: [security.AuthGuardService],
559
+ },
560
+ {
561
+ path: 'choice-fields/field/:id/create-value',
562
+ data: ɵ3,
563
+ component: ChoiceFieldValueCreateComponent,
564
+ canActivate: [security.AuthGuardService],
565
+ },
566
+ {
567
+ path: 'choice-fields/field/:id/value/:valueId',
568
+ data: ɵ4,
569
+ component: ChoiceFieldValueDetailComponent,
570
+ canActivate: [security.AuthGuardService],
571
+ },
572
+ ];
573
+ var ChoiceFieldRoutingModule = /** @class */ (function () {
574
+ function ChoiceFieldRoutingModule() {
575
+ }
576
+ return ChoiceFieldRoutingModule;
577
+ }());
578
+ ChoiceFieldRoutingModule.decorators = [
579
+ { type: i0.NgModule, args: [{
580
+ imports: [common.CommonModule, router.RouterModule.forChild(routes)],
581
+ exports: [router.RouterModule],
582
+ },] }
581
583
  ];
582
584
 
583
- /*
584
- * Copyright 2015-2020 Ritense BV, the Netherlands.
585
- *
586
- * Licensed under EUPL, Version 1.2 (the "License");
587
- * you may not use this file except in compliance with the License.
588
- * You may obtain a copy of the License at
589
- *
590
- * https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12
591
- *
592
- * Unless required by applicable law or agreed to in writing, software
593
- * distributed under the License is distributed on an "AS IS" basis,
594
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
595
- * See the License for the specific language governing permissions and
596
- * limitations under the License.
597
- */
598
- var ChoiceFieldValueListComponent = /** @class */ (function () {
599
- function ChoiceFieldValueListComponent(router, route, formBuilder, service) {
600
- this.router = router;
601
- this.route = route;
602
- this.formBuilder = formBuilder;
603
- this.service = service;
604
- this.choiceFieldValues = [];
605
- this.pagination = {
606
- collectionSize: 0,
607
- page: 1,
608
- size: 10,
609
- maxPaginationItemSize: 5
610
- };
611
- this.pageParam = 0;
612
- this.fields = [{
613
- key: 'id',
614
- label: 'ID'
615
- },
616
- {
617
- key: 'value',
618
- label: 'Key'
619
- },
620
- {
621
- key: 'name',
622
- label: 'Title'
623
- },
624
- {
625
- key: 'deprecatedDisplayString',
626
- label: 'Deprecated'
627
- },
628
- {
629
- key: 'sortOrder',
630
- label: 'Sequence'
631
- }];
632
- var snapshot = this.route.snapshot.paramMap;
633
- this.id = snapshot.get('id');
634
- }
635
- ChoiceFieldValueListComponent.prototype.ngOnInit = function () {
636
- this.paginationSet();
637
- };
638
- ChoiceFieldValueListComponent.prototype.paginationSet = function () {
639
- this.initData(this.id);
640
- };
641
- ChoiceFieldValueListComponent.prototype.initData = function (id) {
642
- var _this = this;
643
- this.service.get(id).subscribe(function (result) {
644
- _this.choiceField = result;
645
- _this.service.queryValues(_this.choiceField.keyName, { page: _this.pageParam, size: _this.pagination.size }).subscribe(function (values) {
646
- _this.pagination.collectionSize = values.headers.get('x-total-count');
647
- _this.choiceFieldValues = values.body;
648
- _this.choiceFieldValues.forEach(function (choiceFieldValue) {
649
- choiceFieldValue.deprecatedDisplayString = choiceFieldValue.deprecated ? 'Yes' : 'No';
650
- });
651
- });
652
- });
653
- };
654
- ChoiceFieldValueListComponent.prototype.rowClick = function (data) {
655
- this.router.navigate(["/choice-fields/field/" + data.choiceField.id + "/value/" + data.id]);
656
- };
657
- ChoiceFieldValueListComponent.prototype.paginationClicked = function (page) {
658
- this.pageParam = page - 1;
659
- this.initData(this.id);
660
- };
661
- return ChoiceFieldValueListComponent;
662
- }());
663
- ChoiceFieldValueListComponent.decorators = [
664
- { type: i0.Component, args: [{
665
- selector: 'valtimo-choice-field-value-list',
666
- 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\">\n <div class=\"container-fluid\">\n <div class=\"text-right\">\n <div class=\"btn-group mt-m3px mb-3\">\n <button [routerLink]=\"'create-value'\" class=\"btn btn-primary btn-space mr-0\">\n <i class=\"icon mdi mdi-plus\"></i> &nbsp;\n <span>{{ 'Create new Choice field value' | translate }}</span>\n </button>\n </div>\n </div>\n <valtimo-widget>\n <valtimo-list [items]=\"choiceFieldValues\"\n [fields]=\"fields\"\n [viewMode]=\"true\"\n [isSearchable]=\"true\"\n (rowClicked)=\"rowClick($event)\"\n [pagination]=\"pagination\"\n paginationIdentifier=\"choiceFieldValueList\"\n (paginationClicked)=\"paginationClicked($event)\"\n [header]=\"true\">\n <div header>\n <h3 class=\"list-header-title\">{{ 'Choice field values' | translate }}</h3>\n <h5 class=\"list-header-description\">{{ 'Overview of all Choice field values' | translate }}</h5>\n </div>\n </valtimo-list>\n </valtimo-widget>\n </div>\n</div>\n",
667
- styles: [""]
668
- },] }
669
- ];
670
- ChoiceFieldValueListComponent.ctorParameters = function () { return [
671
- { type: router.Router },
672
- { type: router.ActivatedRoute },
673
- { type: forms.FormBuilder },
674
- { type: ChoiceFieldService }
585
+ /*
586
+ * Copyright 2015-2020 Ritense BV, the Netherlands.
587
+ *
588
+ * Licensed under EUPL, Version 1.2 (the "License");
589
+ * you may not use this file except in compliance with the License.
590
+ * You may obtain a copy of the License at
591
+ *
592
+ * https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12
593
+ *
594
+ * Unless required by applicable law or agreed to in writing, software
595
+ * distributed under the License is distributed on an "AS IS" basis,
596
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
597
+ * See the License for the specific language governing permissions and
598
+ * limitations under the License.
599
+ */
600
+ var ChoiceFieldValueListComponent = /** @class */ (function () {
601
+ function ChoiceFieldValueListComponent(router, route, formBuilder, service) {
602
+ this.router = router;
603
+ this.route = route;
604
+ this.formBuilder = formBuilder;
605
+ this.service = service;
606
+ this.choiceFieldValues = [];
607
+ this.pagination = {
608
+ collectionSize: 0,
609
+ page: 1,
610
+ size: 10,
611
+ maxPaginationItemSize: 5,
612
+ };
613
+ this.pageParam = 0;
614
+ this.fields = [
615
+ {
616
+ key: 'id',
617
+ label: 'ID',
618
+ },
619
+ {
620
+ key: 'value',
621
+ label: 'Key',
622
+ },
623
+ {
624
+ key: 'name',
625
+ label: 'Title',
626
+ },
627
+ {
628
+ key: 'deprecatedDisplayString',
629
+ label: 'Deprecated',
630
+ },
631
+ {
632
+ key: 'sortOrder',
633
+ label: 'Sequence',
634
+ },
635
+ ];
636
+ var snapshot = this.route.snapshot.paramMap;
637
+ this.id = snapshot.get('id');
638
+ }
639
+ ChoiceFieldValueListComponent.prototype.ngOnInit = function () {
640
+ this.paginationSet();
641
+ };
642
+ ChoiceFieldValueListComponent.prototype.paginationSet = function () {
643
+ this.initData(this.id);
644
+ };
645
+ ChoiceFieldValueListComponent.prototype.initData = function (id) {
646
+ var _this = this;
647
+ this.service.get(id).subscribe(function (result) {
648
+ _this.choiceField = result;
649
+ _this.service
650
+ .queryValues(_this.choiceField.keyName, { page: _this.pageParam, size: _this.pagination.size })
651
+ .subscribe(function (values) {
652
+ _this.pagination.collectionSize = values.headers.get('x-total-count');
653
+ _this.choiceFieldValues = values.body;
654
+ _this.choiceFieldValues.forEach(function (choiceFieldValue) {
655
+ choiceFieldValue.deprecatedDisplayString = choiceFieldValue.deprecated ? 'Yes' : 'No';
656
+ });
657
+ });
658
+ });
659
+ };
660
+ ChoiceFieldValueListComponent.prototype.rowClick = function (data) {
661
+ this.router.navigate(["/choice-fields/field/" + data.choiceField.id + "/value/" + data.id]);
662
+ };
663
+ ChoiceFieldValueListComponent.prototype.paginationClicked = function (page) {
664
+ this.pageParam = page - 1;
665
+ this.initData(this.id);
666
+ };
667
+ return ChoiceFieldValueListComponent;
668
+ }());
669
+ ChoiceFieldValueListComponent.decorators = [
670
+ { type: i0.Component, args: [{
671
+ selector: 'valtimo-choice-field-value-list',
672
+ 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\">\n <div class=\"container-fluid\">\n <div class=\"text-right\">\n <div class=\"btn-group mt-m3px mb-3\">\n <button [routerLink]=\"'create-value'\" class=\"btn btn-primary btn-space mr-0\">\n <i class=\"icon mdi mdi-plus\"></i> &nbsp;\n <span>{{ 'Create new Choice field value' | translate }}</span>\n </button>\n </div>\n </div>\n <valtimo-widget>\n <valtimo-list\n [items]=\"choiceFieldValues\"\n [fields]=\"fields\"\n [viewMode]=\"true\"\n [isSearchable]=\"true\"\n (rowClicked)=\"rowClick($event)\"\n [pagination]=\"pagination\"\n paginationIdentifier=\"choiceFieldValueList\"\n (paginationClicked)=\"paginationClicked($event)\"\n [header]=\"true\"\n >\n <div header>\n <h3 class=\"list-header-title\">{{ 'Choice field values' | translate }}</h3>\n <h5 class=\"list-header-description\">\n {{ 'Overview of all Choice field values' | translate }}\n </h5>\n </div>\n </valtimo-list>\n </valtimo-widget>\n </div>\n</div>\n",
673
+ styles: [""]
674
+ },] }
675
+ ];
676
+ ChoiceFieldValueListComponent.ctorParameters = function () { return [
677
+ { type: router.Router },
678
+ { type: router.ActivatedRoute },
679
+ { type: forms.FormBuilder },
680
+ { type: ChoiceFieldService }
675
681
  ]; };
676
682
 
677
- /*
678
- * Copyright 2015-2020 Ritense BV, the Netherlands.
679
- *
680
- * Licensed under EUPL, Version 1.2 (the "License");
681
- * you may not use this file except in compliance with the License.
682
- * You may obtain a copy of the License at
683
- *
684
- * https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12
685
- *
686
- * Unless required by applicable law or agreed to in writing, software
687
- * distributed under the License is distributed on an "AS IS" basis,
688
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
689
- * See the License for the specific language governing permissions and
690
- * limitations under the License.
691
- */
692
- var ChoiceFieldModule = /** @class */ (function () {
693
- function ChoiceFieldModule() {
694
- }
695
- return ChoiceFieldModule;
696
- }());
697
- ChoiceFieldModule.decorators = [
698
- { type: i0.NgModule, args: [{
699
- declarations: [
700
- ChoiceFieldListComponent,
701
- ChoiceFieldDetailComponent,
702
- ChoiceFieldCreateComponent,
703
- ChoiceFieldValueListComponent,
704
- ChoiceFieldValueCreateComponent,
705
- ChoiceFieldValueDetailComponent
706
- ],
707
- imports: [
708
- common.CommonModule,
709
- components.ListModule,
710
- components.WidgetModule,
711
- components.FieldAutoFocusModule,
712
- forms.FormsModule,
713
- forms.ReactiveFormsModule,
714
- ChoiceFieldRoutingModule,
715
- components.AlertModule,
716
- core.TranslateModule
717
- ],
718
- exports: []
719
- },] }
683
+ /*
684
+ * Copyright 2015-2020 Ritense BV, the Netherlands.
685
+ *
686
+ * Licensed under EUPL, Version 1.2 (the "License");
687
+ * you may not use this file except in compliance with the License.
688
+ * You may obtain a copy of the License at
689
+ *
690
+ * https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12
691
+ *
692
+ * Unless required by applicable law or agreed to in writing, software
693
+ * distributed under the License is distributed on an "AS IS" basis,
694
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
695
+ * See the License for the specific language governing permissions and
696
+ * limitations under the License.
697
+ */
698
+ var ChoiceFieldModule = /** @class */ (function () {
699
+ function ChoiceFieldModule() {
700
+ }
701
+ return ChoiceFieldModule;
702
+ }());
703
+ ChoiceFieldModule.decorators = [
704
+ { type: i0.NgModule, args: [{
705
+ declarations: [
706
+ ChoiceFieldListComponent,
707
+ ChoiceFieldDetailComponent,
708
+ ChoiceFieldCreateComponent,
709
+ ChoiceFieldValueListComponent,
710
+ ChoiceFieldValueCreateComponent,
711
+ ChoiceFieldValueDetailComponent,
712
+ ],
713
+ imports: [
714
+ common.CommonModule,
715
+ components.ListModule,
716
+ components.WidgetModule,
717
+ components.FieldAutoFocusModule,
718
+ forms.FormsModule,
719
+ forms.ReactiveFormsModule,
720
+ ChoiceFieldRoutingModule,
721
+ components.AlertModule,
722
+ core.TranslateModule,
723
+ ],
724
+ exports: [],
725
+ },] }
720
726
  ];
721
727
 
722
- /*
723
- * Copyright 2015-2020 Ritense BV, the Netherlands.
724
- *
725
- * Licensed under EUPL, Version 1.2 (the "License");
726
- * you may not use this file except in compliance with the License.
727
- * You may obtain a copy of the License at
728
- *
729
- * https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12
730
- *
731
- * Unless required by applicable law or agreed to in writing, software
732
- * distributed under the License is distributed on an "AS IS" basis,
733
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
734
- * See the License for the specific language governing permissions and
735
- * limitations under the License.
728
+ /*
729
+ * Copyright 2015-2020 Ritense BV, the Netherlands.
730
+ *
731
+ * Licensed under EUPL, Version 1.2 (the "License");
732
+ * you may not use this file except in compliance with the License.
733
+ * You may obtain a copy of the License at
734
+ *
735
+ * https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12
736
+ *
737
+ * Unless required by applicable law or agreed to in writing, software
738
+ * distributed under the License is distributed on an "AS IS" basis,
739
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
740
+ * See the License for the specific language governing permissions and
741
+ * limitations under the License.
736
742
  */
737
743
 
738
- /**
739
- * Generated bundle index. Do not edit.
744
+ /**
745
+ * Generated bundle index. Do not edit.
740
746
  */
741
747
 
742
748
  exports.ChoiceFieldModule = ChoiceFieldModule;