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

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