@valtimo/milestone 10.8.0 → 11.0.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 (30) hide show
  1. package/{esm2020 → esm2022}/lib/milestone-create/milestone-create.component.mjs +4 -4
  2. package/{esm2020 → esm2022}/lib/milestone-edit/milestone-edit.component.mjs +4 -4
  3. package/esm2022/lib/milestone-list/milestone-list.component.mjs +88 -0
  4. package/{esm2020 → esm2022}/lib/milestone-routing.module.mjs +5 -5
  5. package/{esm2020 → esm2022}/lib/milestone-set-create/milestone-set-create.component.mjs +4 -4
  6. package/{esm2020 → esm2022}/lib/milestone-set-edit/milestone-set-edit.component.mjs +4 -4
  7. package/{esm2020 → esm2022}/lib/milestone.component.mjs +4 -4
  8. package/{esm2020 → esm2022}/lib/milestone.module.mjs +24 -24
  9. package/esm2022/lib/milestone.service.mjs +68 -0
  10. package/{fesm2020 → fesm2022}/valtimo-milestone.mjs +51 -48
  11. package/fesm2022/valtimo-milestone.mjs.map +1 -0
  12. package/lib/milestone-create/milestone-create.component.d.ts +1 -1
  13. package/lib/milestone-edit/milestone-edit.component.d.ts +1 -1
  14. package/lib/milestone-list/milestone-list.component.d.ts +1 -1
  15. package/lib/milestone-list/milestone-list.component.d.ts.map +1 -1
  16. package/lib/milestone-set-create/milestone-set-create.component.d.ts +1 -1
  17. package/lib/milestone-set-edit/milestone-set-edit.component.d.ts +1 -1
  18. package/lib/milestone.component.d.ts +1 -1
  19. package/lib/milestone.service.d.ts.map +1 -1
  20. package/package.json +9 -15
  21. package/esm2020/lib/milestone-list/milestone-list.component.mjs +0 -88
  22. package/esm2020/lib/milestone.service.mjs +0 -68
  23. package/fesm2015/valtimo-milestone.mjs +0 -709
  24. package/fesm2015/valtimo-milestone.mjs.map +0 -1
  25. package/fesm2020/valtimo-milestone.mjs.map +0 -1
  26. /package/{esm2020 → esm2022}/lib/models/index.mjs +0 -0
  27. /package/{esm2020 → esm2022}/lib/models/milestone-set.model.mjs +0 -0
  28. /package/{esm2020 → esm2022}/lib/models/milestone.model.mjs +0 -0
  29. /package/{esm2020 → esm2022}/public-api.mjs +0 -0
  30. /package/{esm2020 → esm2022}/valtimo-milestone.mjs +0 -0
@@ -1,709 +0,0 @@
1
- import * as i0 from '@angular/core';
2
- import { Injectable, Component, NgModule } from '@angular/core';
3
- import * as i1 from '@valtimo/config';
4
- import { ROLE_ADMIN } from '@valtimo/config';
5
- import * as i2 from '@angular/common/http';
6
- import * as i3 from '@angular/router';
7
- import { RouterModule } from '@angular/router';
8
- import { combineLatest } from 'rxjs';
9
- import * as i6 from '@angular/common';
10
- import { CommonModule } from '@angular/common';
11
- import * as i4 from '@valtimo/components';
12
- import { ListModule, WidgetModule } from '@valtimo/components';
13
- import * as i3$1 from '@ngx-translate/core';
14
- import { TranslateModule } from '@ngx-translate/core';
15
- import * as i2$1 from '@angular/forms';
16
- import { FormControl, Validators, ReactiveFormsModule } from '@angular/forms';
17
- import { AuthGuardService } from '@valtimo/security';
18
- import * as i5 from '@valtimo/process';
19
- import * as i7 from 'ngx-color-picker';
20
- import { ColorPickerModule } from 'ngx-color-picker';
21
- import { switchMap } from 'rxjs/operators';
22
-
23
- /*
24
- * Copyright 2015-2023 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
- * Copyright 2015-2023 Ritense BV, the Netherlands.
41
- *
42
- * Licensed under EUPL, Version 1.2 (the "License");
43
- * you may not use this file except in compliance with the License.
44
- * You may obtain a copy of the License at
45
- *
46
- * https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12
47
- *
48
- * Unless required by applicable law or agreed to in writing, software
49
- * distributed under the License is distributed on an "AS IS" basis,
50
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
51
- * See the License for the specific language governing permissions and
52
- * limitations under the License.
53
- */
54
- class MilestoneService {
55
- constructor(configService, http) {
56
- this.configService = configService;
57
- this.http = http;
58
- this.valtimoApiConfig = configService.config.valtimoApi;
59
- }
60
- getMilestones() {
61
- return this.http.get(`${this.valtimoApiConfig.endpointUri}v1/milestones`);
62
- }
63
- getMilestone(milestoneId) {
64
- return this.http.get(`${this.valtimoApiConfig.endpointUri}v1/milestones/${milestoneId}`);
65
- }
66
- createMilestone(milestone) {
67
- return this.http.post(`${this.valtimoApiConfig.endpointUri}v1/milestones`, milestone);
68
- }
69
- updateMilestone(milestone) {
70
- return this.http.post(`${this.valtimoApiConfig.endpointUri}v1/milestones`, milestone);
71
- }
72
- deleteMilestone(milestoneId) {
73
- return this.http.delete(`${this.valtimoApiConfig.endpointUri}v1/milestones/${milestoneId}`);
74
- }
75
- getMilestoneSets() {
76
- return this.http.get(`${this.valtimoApiConfig.endpointUri}v1/milestone-sets`);
77
- }
78
- getMilestoneSet(milestoneSetId) {
79
- return this.http.get(`${this.valtimoApiConfig.endpointUri}v1/milestone-sets/${milestoneSetId}`);
80
- }
81
- createMilestoneSet(milestoneSet) {
82
- return this.http.post(`${this.valtimoApiConfig.endpointUri}v1/milestone-sets`, milestoneSet);
83
- }
84
- updateMilestoneSet(milestoneSet) {
85
- return this.http.post(`${this.valtimoApiConfig.endpointUri}v1/milestone-sets`, milestoneSet);
86
- }
87
- deleteMilestoneSet(milestoneSetId) {
88
- return this.http.delete(`${this.valtimoApiConfig.endpointUri}v1/milestone-sets/${milestoneSetId}`);
89
- }
90
- getFlownodes(processDefinitionId) {
91
- return this.http.get(`${this.valtimoApiConfig.endpointUri}v1/milestones/${processDefinitionId}/flownodes`);
92
- }
93
- }
94
- MilestoneService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: MilestoneService, deps: [{ token: i1.ConfigService }, { token: i2.HttpClient }], target: i0.ɵɵFactoryTarget.Injectable });
95
- MilestoneService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: MilestoneService, providedIn: 'root' });
96
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: MilestoneService, decorators: [{
97
- type: Injectable,
98
- args: [{
99
- providedIn: 'root',
100
- }]
101
- }], ctorParameters: function () { return [{ type: i1.ConfigService }, { type: i2.HttpClient }]; } });
102
-
103
- /*
104
- * Copyright 2015-2023 Ritense BV, the Netherlands.
105
- *
106
- * Licensed under EUPL, Version 1.2 (the "License");
107
- * you may not use this file except in compliance with the License.
108
- * You may obtain a copy of the License at
109
- *
110
- * https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12
111
- *
112
- * Unless required by applicable law or agreed to in writing, software
113
- * distributed under the License is distributed on an "AS IS" basis,
114
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
115
- * See the License for the specific language governing permissions and
116
- * limitations under the License.
117
- */
118
- class MilestoneListComponent {
119
- constructor(milestoneService, router) {
120
- this.milestoneService = milestoneService;
121
- this.router = router;
122
- this.milestones = [];
123
- this.milestoneFields = [
124
- { key: 'id', label: 'ID' },
125
- { key: 'title', label: 'Title' },
126
- { key: 'processDefinitionKey', label: 'Process' },
127
- { key: 'taskDefinitionKey', label: 'Task' },
128
- { key: 'plannedIntervalInDays', label: 'Interval (in days)' },
129
- { key: 'color', label: 'Color' },
130
- ];
131
- }
132
- editMilestoneSet(milestoneSetId) {
133
- this.router.navigate(['milestones/sets/set', milestoneSetId]);
134
- }
135
- editMilestone(milestone) {
136
- this.router.navigate(['milestones/milestone', milestone.id]);
137
- }
138
- ngOnInit() {
139
- combineLatest([
140
- this.milestoneService.getMilestones(),
141
- this.milestoneService.getMilestoneSets(),
142
- ]).subscribe(([milestones, milestoneSets]) => this.handleMilestoneResult(milestones, milestoneSets));
143
- }
144
- handleMilestoneResult(milestones, milestoneSets) {
145
- const milestoneSetsMap = this.getMilestoneSetsMap(milestones, milestoneSets);
146
- this.setMilestones(milestoneSetsMap);
147
- }
148
- setMilestones(milestoneSetsMap) {
149
- this.milestones = Array.from(milestoneSetsMap.entries()).map(entry => {
150
- entry[0] = JSON.parse(entry[0]);
151
- return entry;
152
- });
153
- }
154
- getMilestoneSetsMap(milestones, milestoneSets) {
155
- const mapWithSets = this.addMilestoneSetsToMap(milestoneSets, this.getEmptyMap());
156
- return this.addMilestonesToMap(milestones, mapWithSets);
157
- }
158
- getEmptyMap() {
159
- return new Map();
160
- }
161
- addMilestoneSetsToMap(milestoneSets, map) {
162
- milestoneSets.forEach(milestoneSet => {
163
- map.set(JSON.stringify(milestoneSet), []);
164
- });
165
- return map;
166
- }
167
- addMilestonesToMap(milestones, map) {
168
- milestones.forEach(milestone => {
169
- const milestoneSetString = JSON.stringify(milestone.milestoneSet);
170
- const arr = map.get(milestoneSetString);
171
- arr.push(milestone);
172
- map.set(milestoneSetString, arr);
173
- });
174
- return map;
175
- }
176
- }
177
- MilestoneListComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: MilestoneListComponent, deps: [{ token: MilestoneService }, { token: i3.Router }], target: i0.ɵɵFactoryTarget.Component });
178
- MilestoneListComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "14.3.0", type: MilestoneListComponent, selector: "valtimo-milestone-list", ngImport: i0, template: "<!--\n ~ Copyright 2015-2023 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 *ngFor=\"let milestoneGroup of milestones\" class=\"mb-4\">\n <valtimo-widget>\n <h4 (click)=\"editMilestoneSet(milestoneGroup[0].id)\" class=\"milestone-title\">\n {{ milestoneGroup[0].title }} ({{ milestoneGroup[0].id }})\n </h4>\n <valtimo-list\n [items]=\"milestoneGroup[1]\"\n [fields]=\"milestoneFields\"\n (rowClicked)=\"editMilestone($event)\"\n >\n </valtimo-list>\n </valtimo-widget>\n</div>\n", styles: ["/*!\n * Copyright 2015-2023 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 */.milestone-title{background-color:#f8f9f9;margin:0;padding:1em;border-bottom:1px solid #dee2e6;cursor:pointer}\n"], dependencies: [{ kind: "directive", type: i6.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "component", type: i4.ListComponent, selector: "valtimo-list", inputs: ["items", "fields", "pagination", "viewMode", "isSearchable", "header", "actions", "paginationIdentifier", "initialSortState", "lastColumnTemplate"], outputs: ["rowClicked", "paginationClicked", "paginationSet", "search", "sortChanged"] }, { kind: "component", type: i4.WidgetComponent, selector: "valtimo-widget", inputs: ["type", "name", "icon", "contrast", "divider", "title", "subtitle", "collapseAble", "collapse", "additionalClasses"] }] });
179
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: MilestoneListComponent, decorators: [{
180
- type: Component,
181
- args: [{ selector: 'valtimo-milestone-list', template: "<!--\n ~ Copyright 2015-2023 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 *ngFor=\"let milestoneGroup of milestones\" class=\"mb-4\">\n <valtimo-widget>\n <h4 (click)=\"editMilestoneSet(milestoneGroup[0].id)\" class=\"milestone-title\">\n {{ milestoneGroup[0].title }} ({{ milestoneGroup[0].id }})\n </h4>\n <valtimo-list\n [items]=\"milestoneGroup[1]\"\n [fields]=\"milestoneFields\"\n (rowClicked)=\"editMilestone($event)\"\n >\n </valtimo-list>\n </valtimo-widget>\n</div>\n", styles: ["/*!\n * Copyright 2015-2023 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 */.milestone-title{background-color:#f8f9f9;margin:0;padding:1em;border-bottom:1px solid #dee2e6;cursor:pointer}\n"] }]
182
- }], ctorParameters: function () { return [{ type: MilestoneService }, { type: i3.Router }]; } });
183
-
184
- /*
185
- * Copyright 2015-2023 Ritense BV, the Netherlands.
186
- *
187
- * Licensed under EUPL, Version 1.2 (the "License");
188
- * you may not use this file except in compliance with the License.
189
- * You may obtain a copy of the License at
190
- *
191
- * https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12
192
- *
193
- * Unless required by applicable law or agreed to in writing, software
194
- * distributed under the License is distributed on an "AS IS" basis,
195
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
196
- * See the License for the specific language governing permissions and
197
- * limitations under the License.
198
- */
199
- class MilestoneComponent {
200
- constructor() { }
201
- ngOnInit() { }
202
- }
203
- MilestoneComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: MilestoneComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
204
- MilestoneComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "14.3.0", type: MilestoneComponent, selector: "valtimo-milestone", ngImport: i0, template: "<!--\n ~ Copyright 2015-2023 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]=\"'sets/create'\" class=\"btn btn-primary btn-space\">\n <i class=\"icon mdi mdi-plus\"></i> &nbsp;\n <span>{{ 'Create new Milestone Set' | translate }}</span>\n </button>\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 Milestone' | translate }}</span>\n </button>\n </div>\n </div>\n <valtimo-milestone-list></valtimo-milestone-list>\n </div>\n</div>\n", styles: ["/*!\n * Copyright 2015-2023 Ritense BV, the Netherlands.\n *\n * Licensed under EUPL, Version 1.2 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" basis,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n"], dependencies: [{ kind: "directive", type: i3.RouterLink, selector: ":not(a):not(area)[routerLink]", inputs: ["queryParams", "fragment", "queryParamsHandling", "state", "relativeTo", "preserveFragment", "skipLocationChange", "replaceUrl", "routerLink"] }, { kind: "component", type: MilestoneListComponent, selector: "valtimo-milestone-list" }, { kind: "pipe", type: i3$1.TranslatePipe, name: "translate" }] });
205
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: MilestoneComponent, decorators: [{
206
- type: Component,
207
- args: [{ selector: 'valtimo-milestone', template: "<!--\n ~ Copyright 2015-2023 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]=\"'sets/create'\" class=\"btn btn-primary btn-space\">\n <i class=\"icon mdi mdi-plus\"></i> &nbsp;\n <span>{{ 'Create new Milestone Set' | translate }}</span>\n </button>\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 Milestone' | translate }}</span>\n </button>\n </div>\n </div>\n <valtimo-milestone-list></valtimo-milestone-list>\n </div>\n</div>\n", styles: ["/*!\n * Copyright 2015-2023 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"] }]
208
- }], ctorParameters: function () { return []; } });
209
-
210
- /*
211
- * Copyright 2015-2023 Ritense BV, the Netherlands.
212
- *
213
- * Licensed under EUPL, Version 1.2 (the "License");
214
- * you may not use this file except in compliance with the License.
215
- * You may obtain a copy of the License at
216
- *
217
- * https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12
218
- *
219
- * Unless required by applicable law or agreed to in writing, software
220
- * distributed under the License is distributed on an "AS IS" basis,
221
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
222
- * See the License for the specific language governing permissions and
223
- * limitations under the License.
224
- */
225
- class MilestoneSetCreateComponent {
226
- constructor(milestoneService, formBuilder, router, alertService) {
227
- this.milestoneService = milestoneService;
228
- this.formBuilder = formBuilder;
229
- this.router = router;
230
- this.alertService = alertService;
231
- }
232
- get formControls() {
233
- return this.form.controls;
234
- }
235
- ngOnInit() {
236
- this.form = this.formBuilder.group({
237
- title: new FormControl('', Validators.required),
238
- });
239
- }
240
- reset() {
241
- this.form.setValue({
242
- title: '',
243
- });
244
- }
245
- createMilestoneSet() {
246
- this.milestoneService.createMilestoneSet(this.form.value).subscribe(() => {
247
- this.router.navigate(['/milestones']);
248
- this.alertService.success('New Milestone set has been created');
249
- });
250
- }
251
- }
252
- MilestoneSetCreateComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: MilestoneSetCreateComponent, deps: [{ token: MilestoneService }, { token: i2$1.FormBuilder }, { token: i3.Router }, { token: i4.AlertService }], target: i0.ɵɵFactoryTarget.Component });
253
- MilestoneSetCreateComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "14.3.0", type: MilestoneSetCreateComponent, selector: "valtimo-milestone-set-create", ngImport: i0, template: "<!--\n ~ Copyright 2015-2023 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 class=\"bg-white p-5\">\n <form [formGroup]=\"form\" (ngSubmit)=\"createMilestoneSet()\">\n <div class=\"form-group row\">\n <label class=\"col-12 col-sm-3 col-form-label text-sm-right\" for=\"title\">Title</label>\n <div class=\"col-12 col-sm-8 col-lg-6\">\n <input\n type=\"text\"\n id=\"title\"\n formControlName=\"title\"\n class=\"form-control\"\n placeholder=\"Milestone set 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]=\"'/milestones'\" 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 </valtimo-widget>\n </div>\n </div>\n</div>\n", styles: ["/*!\n * Copyright 2015-2023 Ritense BV, the Netherlands.\n *\n * Licensed under EUPL, Version 1.2 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" basis,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n"], dependencies: [{ kind: "directive", type: i3.RouterLinkWithHref, selector: "a[routerLink],area[routerLink]", inputs: ["target", "queryParams", "fragment", "queryParamsHandling", "state", "relativeTo", "preserveFragment", "skipLocationChange", "replaceUrl", "routerLink"] }, { kind: "directive", type: i6.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "directive", type: i6.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "component", type: i4.WidgetComponent, selector: "valtimo-widget", inputs: ["type", "name", "icon", "contrast", "divider", "title", "subtitle", "collapseAble", "collapse", "additionalClasses"] }, { kind: "directive", type: i2$1.ɵNgNoValidate, selector: "form:not([ngNoForm]):not([ngNativeValidate])" }, { kind: "directive", type: i2$1.DefaultValueAccessor, selector: "input:not([type=checkbox])[formControlName],textarea[formControlName],input:not([type=checkbox])[formControl],textarea[formControl],input:not([type=checkbox])[ngModel],textarea[ngModel],[ngDefaultControl]" }, { kind: "directive", type: i2$1.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i2$1.NgControlStatusGroup, selector: "[formGroupName],[formArrayName],[ngModelGroup],[formGroup],form:not([ngNoForm]),[ngForm]" }, { kind: "directive", type: i2$1.RequiredValidator, selector: ":not([type=checkbox])[required][formControlName],:not([type=checkbox])[required][formControl],:not([type=checkbox])[required][ngModel]", inputs: ["required"] }, { kind: "directive", type: i2$1.FormGroupDirective, selector: "[formGroup]", inputs: ["formGroup"], outputs: ["ngSubmit"], exportAs: ["ngForm"] }, { kind: "directive", type: i2$1.FormControlName, selector: "[formControlName]", inputs: ["formControlName", "disabled", "ngModel"], outputs: ["ngModelChange"] }] });
254
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: MilestoneSetCreateComponent, decorators: [{
255
- type: Component,
256
- args: [{ selector: 'valtimo-milestone-set-create', template: "<!--\n ~ Copyright 2015-2023 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 class=\"bg-white p-5\">\n <form [formGroup]=\"form\" (ngSubmit)=\"createMilestoneSet()\">\n <div class=\"form-group row\">\n <label class=\"col-12 col-sm-3 col-form-label text-sm-right\" for=\"title\">Title</label>\n <div class=\"col-12 col-sm-8 col-lg-6\">\n <input\n type=\"text\"\n id=\"title\"\n formControlName=\"title\"\n class=\"form-control\"\n placeholder=\"Milestone set 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]=\"'/milestones'\" 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 </valtimo-widget>\n </div>\n </div>\n</div>\n", styles: ["/*!\n * Copyright 2015-2023 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"] }]
257
- }], ctorParameters: function () { return [{ type: MilestoneService }, { type: i2$1.FormBuilder }, { type: i3.Router }, { type: i4.AlertService }]; } });
258
-
259
- /*
260
- * Copyright 2015-2023 Ritense BV, the Netherlands.
261
- *
262
- * Licensed under EUPL, Version 1.2 (the "License");
263
- * you may not use this file except in compliance with the License.
264
- * You may obtain a copy of the License at
265
- *
266
- * https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12
267
- *
268
- * Unless required by applicable law or agreed to in writing, software
269
- * distributed under the License is distributed on an "AS IS" basis,
270
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
271
- * See the License for the specific language governing permissions and
272
- * limitations under the License.
273
- */
274
- class MilestoneCreateComponent {
275
- constructor(milestoneService, formBuilder, router, alertService, processService) {
276
- this.milestoneService = milestoneService;
277
- this.formBuilder = formBuilder;
278
- this.router = router;
279
- this.alertService = alertService;
280
- this.processService = processService;
281
- this.milestoneSets = [];
282
- this.processDefinitions = [];
283
- this.taskDefinitions = [];
284
- }
285
- get formControls() {
286
- return this.form.controls;
287
- }
288
- ngOnInit() {
289
- this.form = this.formBuilder.group({
290
- milestoneSet: new FormControl('', Validators.required),
291
- title: new FormControl('', Validators.required),
292
- processDefinitionKey: new FormControl('', Validators.required),
293
- taskDefinitionKey: new FormControl('', Validators.required),
294
- plannedIntervalInDays: new FormControl('', [
295
- Validators.required,
296
- Validators.pattern('^[0-9]*$'),
297
- ]),
298
- color: new FormControl('', [
299
- Validators.required,
300
- Validators.pattern('^#([A-Fa-f0-9]{6}|[A-Fa-f0-9]{3})$'),
301
- ]),
302
- });
303
- this.getMilestoneSets();
304
- this.getMilestones();
305
- }
306
- reset() {
307
- this.form.patchValue({
308
- milestoneSet: '',
309
- title: '',
310
- processDefinitionKey: '',
311
- taskDefinitionKey: '',
312
- plannedIntervalInDays: '',
313
- color: '',
314
- });
315
- }
316
- getMilestoneSets() {
317
- this.milestoneService.getMilestoneSets().subscribe((milesetoneSets) => {
318
- this.milestoneSets = milesetoneSets;
319
- });
320
- }
321
- getMilestones() {
322
- this.processService
323
- .getProcessDefinitions()
324
- .subscribe((processDefinitions) => {
325
- this.processDefinitions = processDefinitions;
326
- });
327
- }
328
- getFlownodes(processDefinitionId) {
329
- if (processDefinitionId) {
330
- this.milestoneService.getFlownodes(processDefinitionId).subscribe((flowNodes) => {
331
- this.taskDefinitions = flowNodes['flowNodeMap'];
332
- this.form.controls.taskDefinitionKey.setValue('');
333
- });
334
- }
335
- }
336
- createMilestone() {
337
- const milestone = this.form.value;
338
- milestone.processDefinitionKey = milestone.processDefinitionKey['key'];
339
- milestone.id = null;
340
- this.milestoneService.createMilestone(milestone).subscribe(() => {
341
- this.router.navigate(['/milestones']);
342
- this.alertService.success('New Milestone has been created');
343
- }, err => {
344
- this.alertService.error('Error creating new milestone');
345
- });
346
- }
347
- }
348
- MilestoneCreateComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: MilestoneCreateComponent, deps: [{ token: MilestoneService }, { token: i2$1.FormBuilder }, { token: i3.Router }, { token: i4.AlertService }, { token: i5.ProcessService }], target: i0.ɵɵFactoryTarget.Component });
349
- MilestoneCreateComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "14.3.0", type: MilestoneCreateComponent, selector: "valtimo-milestone-create", ngImport: i0, template: "<!--\n ~ Copyright 2015-2023 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 class=\"bg-white p-5\">\n <form [formGroup]=\"form\" (ngSubmit)=\"createMilestone()\">\n <div class=\"form-group row\">\n <label class=\"col-12 col-sm-3 col-form-label text-sm-right\" for=\"title\"\n >Milestone set</label\n >\n <div class=\"col-12 col-sm-8 col-lg-6\">\n <select\n type=\"text\"\n id=\"milestoneSet\"\n formControlName=\"milestoneSet\"\n class=\"form-control\"\n [ngClass]=\"{\n 'is-valid':\n formControls.milestoneSet.touched && formControls.milestoneSet.valid,\n 'is-invalid':\n formControls.milestoneSet.touched && formControls.milestoneSet.errors\n }\"\n required\n >\n <option value=\"\" selected disabled>Choose a Milestone set</option>\n <option *ngFor=\"let milestoneSet of milestoneSets\" [value]=\"milestoneSet.id\">\n {{ milestoneSet.title }} ({{ milestoneSet.id }})\n </option>\n </select>\n <div\n *ngIf=\"formControls.milestoneSet.touched && formControls.milestoneSet.errors\"\n class=\"invalid-feedback\"\n >\n <div *ngIf=\"formControls.milestoneSet.errors.required\">\n Milestone set 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=\"title\">Title</label>\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=\"Milestone 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=\"form-group row\">\n <label class=\"col-12 col-sm-3 col-form-label text-sm-right\" for=\"process\"\n >Process definition</label\n >\n <div class=\"col-12 col-sm-8 col-lg-6\">\n <select\n type=\"text\"\n id=\"process\"\n formControlName=\"processDefinitionKey\"\n class=\"form-control\"\n (ngModelChange)=\"getFlownodes($event.id)\"\n [ngClass]=\"{\n 'is-valid':\n formControls.processDefinitionKey.touched &&\n formControls.processDefinitionKey.valid,\n 'is-invalid':\n formControls.processDefinitionKey.touched &&\n formControls.processDefinitionKey.errors\n }\"\n required\n >\n <option value=\"\" selected disabled>Choose a process</option>\n <option\n *ngFor=\"let processDefinition of processDefinitions\"\n [ngValue]=\"processDefinition\"\n >\n {{ processDefinition.name }} ({{ processDefinition.key }})\n </option>\n </select>\n <div\n *ngIf=\"\n formControls.processDefinitionKey.touched &&\n formControls.processDefinitionKey.errors\n \"\n class=\"invalid-feedback\"\n >\n <div *ngIf=\"formControls.processDefinitionKey.errors.required\">\n Process 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=\"process\">Task</label>\n <div class=\"col-12 col-sm-8 col-lg-6\">\n <select\n type=\"text\"\n id=\"task\"\n formControlName=\"taskDefinitionKey\"\n class=\"form-control\"\n [ngClass]=\"{\n 'is-valid':\n formControls.taskDefinitionKey.touched &&\n formControls.taskDefinitionKey.valid,\n 'is-invalid':\n formControls.taskDefinitionKey.touched &&\n formControls.taskDefinitionKey.errors\n }\"\n required\n >\n <option value=\"\" selected disabled>Choose a task</option>\n <option\n *ngFor=\"let taskDefinition of taskDefinitions | keyvalue\"\n [value]=\"taskDefinition.key\"\n >\n {{ taskDefinition.value }} ({{ taskDefinition.key }})\n </option>\n </select>\n <div\n *ngIf=\"\n formControls.taskDefinitionKey.touched && formControls.taskDefinitionKey.errors\n \"\n class=\"invalid-feedback\"\n >\n <div *ngIf=\"formControls.taskDefinitionKey.errors.required\">Task 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=\"interval\"\n >Interval (in days)</label\n >\n <div class=\"col-12 col-sm-8 col-lg-6\">\n <input\n type=\"text\"\n id=\"interval\"\n formControlName=\"plannedIntervalInDays\"\n class=\"form-control\"\n placeholder=\"Interval (in days)\"\n [ngClass]=\"{\n 'is-valid':\n formControls.plannedIntervalInDays.touched &&\n formControls.plannedIntervalInDays.valid,\n 'is-invalid':\n formControls.plannedIntervalInDays.touched &&\n formControls.plannedIntervalInDays.errors\n }\"\n required\n />\n <div\n *ngIf=\"\n formControls.plannedIntervalInDays.touched &&\n formControls.plannedIntervalInDays.errors\n \"\n class=\"invalid-feedback\"\n >\n <div *ngIf=\"formControls.plannedIntervalInDays.errors.required\">\n Interval is required\n </div>\n <div *ngIf=\"formControls.plannedIntervalInDays.errors.pattern\">\n Interval is not a valid number\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=\"color\">Color</label>\n <div class=\"col-12 col-sm-8 col-lg-6\">\n <input\n [colorPicker]=\"form.value.color\"\n (colorPickerChange)=\"form.controls.color.setValue($event)\"\n [style.background]=\"form.value.color\"\n type=\"text\"\n id=\"color\"\n formControlName=\"color\"\n class=\"form-control\"\n placeholder=\"Color\"\n [ngClass]=\"{\n 'is-valid': formControls.color.touched && formControls.color.valid,\n 'is-invalid': formControls.color.touched && formControls.color.errors\n }\"\n required\n />\n <div\n *ngIf=\"formControls.color.touched && formControls.color.errors\"\n class=\"invalid-feedback\"\n >\n <div *ngIf=\"formControls.color.errors.required\">Interval is required</div>\n <div *ngIf=\"formControls.color.errors.pattern\">Color is not a valid hex code</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]=\"'/milestones'\" 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 </valtimo-widget>\n </div>\n </div>\n</div>\n", styles: ["/*!\n * Copyright 2015-2023 Ritense BV, the Netherlands.\n *\n * Licensed under EUPL, Version 1.2 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" basis,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n"], dependencies: [{ kind: "directive", type: i3.RouterLinkWithHref, selector: "a[routerLink],area[routerLink]", inputs: ["target", "queryParams", "fragment", "queryParamsHandling", "state", "relativeTo", "preserveFragment", "skipLocationChange", "replaceUrl", "routerLink"] }, { kind: "directive", type: i6.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "directive", type: i6.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "directive", type: i6.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "component", type: i4.WidgetComponent, selector: "valtimo-widget", inputs: ["type", "name", "icon", "contrast", "divider", "title", "subtitle", "collapseAble", "collapse", "additionalClasses"] }, { kind: "directive", type: i2$1.ɵNgNoValidate, selector: "form:not([ngNoForm]):not([ngNativeValidate])" }, { kind: "directive", type: i2$1.NgSelectOption, selector: "option", inputs: ["ngValue", "value"] }, { kind: "directive", type: i2$1.ɵNgSelectMultipleOption, selector: "option", inputs: ["ngValue", "value"] }, { kind: "directive", type: i2$1.DefaultValueAccessor, selector: "input:not([type=checkbox])[formControlName],textarea[formControlName],input:not([type=checkbox])[formControl],textarea[formControl],input:not([type=checkbox])[ngModel],textarea[ngModel],[ngDefaultControl]" }, { kind: "directive", type: i2$1.SelectControlValueAccessor, selector: "select:not([multiple])[formControlName],select:not([multiple])[formControl],select:not([multiple])[ngModel]", inputs: ["compareWith"] }, { kind: "directive", type: i2$1.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i2$1.NgControlStatusGroup, selector: "[formGroupName],[formArrayName],[ngModelGroup],[formGroup],form:not([ngNoForm]),[ngForm]" }, { kind: "directive", type: i2$1.RequiredValidator, selector: ":not([type=checkbox])[required][formControlName],:not([type=checkbox])[required][formControl],:not([type=checkbox])[required][ngModel]", inputs: ["required"] }, { kind: "directive", type: i2$1.FormGroupDirective, selector: "[formGroup]", inputs: ["formGroup"], outputs: ["ngSubmit"], exportAs: ["ngForm"] }, { kind: "directive", type: i2$1.FormControlName, selector: "[formControlName]", inputs: ["formControlName", "disabled", "ngModel"], outputs: ["ngModelChange"] }, { kind: "directive", type: i7.ColorPickerDirective, selector: "[colorPicker]", inputs: ["colorPicker", "cpWidth", "cpHeight", "cpToggle", "cpDisabled", "cpIgnoredElements", "cpFallbackColor", "cpColorMode", "cpCmykEnabled", "cpOutputFormat", "cpAlphaChannel", "cpDisableInput", "cpDialogDisplay", "cpSaveClickOutside", "cpCloseClickOutside", "cpUseRootViewContainer", "cpPosition", "cpPositionOffset", "cpPositionRelativeToArrow", "cpOKButton", "cpOKButtonText", "cpOKButtonClass", "cpCancelButton", "cpCancelButtonText", "cpCancelButtonClass", "cpEyeDropper", "cpPresetLabel", "cpPresetColors", "cpPresetColorsClass", "cpMaxPresetColorsLength", "cpPresetEmptyMessage", "cpPresetEmptyMessageClass", "cpAddColorButton", "cpAddColorButtonText", "cpAddColorButtonClass", "cpRemoveColorButtonClass", "cpExtraTemplate"], outputs: ["cpInputChange", "cpToggleChange", "cpSliderChange", "cpSliderDragEnd", "cpSliderDragStart", "colorPickerOpen", "colorPickerClose", "colorPickerCancel", "colorPickerSelect", "colorPickerChange", "cpCmykColorChange", "cpPresetColorsChange"], exportAs: ["ngxColorPicker"] }, { kind: "pipe", type: i6.KeyValuePipe, name: "keyvalue" }] });
350
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: MilestoneCreateComponent, decorators: [{
351
- type: Component,
352
- args: [{ selector: 'valtimo-milestone-create', template: "<!--\n ~ Copyright 2015-2023 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 class=\"bg-white p-5\">\n <form [formGroup]=\"form\" (ngSubmit)=\"createMilestone()\">\n <div class=\"form-group row\">\n <label class=\"col-12 col-sm-3 col-form-label text-sm-right\" for=\"title\"\n >Milestone set</label\n >\n <div class=\"col-12 col-sm-8 col-lg-6\">\n <select\n type=\"text\"\n id=\"milestoneSet\"\n formControlName=\"milestoneSet\"\n class=\"form-control\"\n [ngClass]=\"{\n 'is-valid':\n formControls.milestoneSet.touched && formControls.milestoneSet.valid,\n 'is-invalid':\n formControls.milestoneSet.touched && formControls.milestoneSet.errors\n }\"\n required\n >\n <option value=\"\" selected disabled>Choose a Milestone set</option>\n <option *ngFor=\"let milestoneSet of milestoneSets\" [value]=\"milestoneSet.id\">\n {{ milestoneSet.title }} ({{ milestoneSet.id }})\n </option>\n </select>\n <div\n *ngIf=\"formControls.milestoneSet.touched && formControls.milestoneSet.errors\"\n class=\"invalid-feedback\"\n >\n <div *ngIf=\"formControls.milestoneSet.errors.required\">\n Milestone set 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=\"title\">Title</label>\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=\"Milestone 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=\"form-group row\">\n <label class=\"col-12 col-sm-3 col-form-label text-sm-right\" for=\"process\"\n >Process definition</label\n >\n <div class=\"col-12 col-sm-8 col-lg-6\">\n <select\n type=\"text\"\n id=\"process\"\n formControlName=\"processDefinitionKey\"\n class=\"form-control\"\n (ngModelChange)=\"getFlownodes($event.id)\"\n [ngClass]=\"{\n 'is-valid':\n formControls.processDefinitionKey.touched &&\n formControls.processDefinitionKey.valid,\n 'is-invalid':\n formControls.processDefinitionKey.touched &&\n formControls.processDefinitionKey.errors\n }\"\n required\n >\n <option value=\"\" selected disabled>Choose a process</option>\n <option\n *ngFor=\"let processDefinition of processDefinitions\"\n [ngValue]=\"processDefinition\"\n >\n {{ processDefinition.name }} ({{ processDefinition.key }})\n </option>\n </select>\n <div\n *ngIf=\"\n formControls.processDefinitionKey.touched &&\n formControls.processDefinitionKey.errors\n \"\n class=\"invalid-feedback\"\n >\n <div *ngIf=\"formControls.processDefinitionKey.errors.required\">\n Process 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=\"process\">Task</label>\n <div class=\"col-12 col-sm-8 col-lg-6\">\n <select\n type=\"text\"\n id=\"task\"\n formControlName=\"taskDefinitionKey\"\n class=\"form-control\"\n [ngClass]=\"{\n 'is-valid':\n formControls.taskDefinitionKey.touched &&\n formControls.taskDefinitionKey.valid,\n 'is-invalid':\n formControls.taskDefinitionKey.touched &&\n formControls.taskDefinitionKey.errors\n }\"\n required\n >\n <option value=\"\" selected disabled>Choose a task</option>\n <option\n *ngFor=\"let taskDefinition of taskDefinitions | keyvalue\"\n [value]=\"taskDefinition.key\"\n >\n {{ taskDefinition.value }} ({{ taskDefinition.key }})\n </option>\n </select>\n <div\n *ngIf=\"\n formControls.taskDefinitionKey.touched && formControls.taskDefinitionKey.errors\n \"\n class=\"invalid-feedback\"\n >\n <div *ngIf=\"formControls.taskDefinitionKey.errors.required\">Task 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=\"interval\"\n >Interval (in days)</label\n >\n <div class=\"col-12 col-sm-8 col-lg-6\">\n <input\n type=\"text\"\n id=\"interval\"\n formControlName=\"plannedIntervalInDays\"\n class=\"form-control\"\n placeholder=\"Interval (in days)\"\n [ngClass]=\"{\n 'is-valid':\n formControls.plannedIntervalInDays.touched &&\n formControls.plannedIntervalInDays.valid,\n 'is-invalid':\n formControls.plannedIntervalInDays.touched &&\n formControls.plannedIntervalInDays.errors\n }\"\n required\n />\n <div\n *ngIf=\"\n formControls.plannedIntervalInDays.touched &&\n formControls.plannedIntervalInDays.errors\n \"\n class=\"invalid-feedback\"\n >\n <div *ngIf=\"formControls.plannedIntervalInDays.errors.required\">\n Interval is required\n </div>\n <div *ngIf=\"formControls.plannedIntervalInDays.errors.pattern\">\n Interval is not a valid number\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=\"color\">Color</label>\n <div class=\"col-12 col-sm-8 col-lg-6\">\n <input\n [colorPicker]=\"form.value.color\"\n (colorPickerChange)=\"form.controls.color.setValue($event)\"\n [style.background]=\"form.value.color\"\n type=\"text\"\n id=\"color\"\n formControlName=\"color\"\n class=\"form-control\"\n placeholder=\"Color\"\n [ngClass]=\"{\n 'is-valid': formControls.color.touched && formControls.color.valid,\n 'is-invalid': formControls.color.touched && formControls.color.errors\n }\"\n required\n />\n <div\n *ngIf=\"formControls.color.touched && formControls.color.errors\"\n class=\"invalid-feedback\"\n >\n <div *ngIf=\"formControls.color.errors.required\">Interval is required</div>\n <div *ngIf=\"formControls.color.errors.pattern\">Color is not a valid hex code</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]=\"'/milestones'\" 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 </valtimo-widget>\n </div>\n </div>\n</div>\n", styles: ["/*!\n * Copyright 2015-2023 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"] }]
353
- }], ctorParameters: function () { return [{ type: MilestoneService }, { type: i2$1.FormBuilder }, { type: i3.Router }, { type: i4.AlertService }, { type: i5.ProcessService }]; } });
354
-
355
- /*
356
- * Copyright 2015-2023 Ritense BV, the Netherlands.
357
- *
358
- * Licensed under EUPL, Version 1.2 (the "License");
359
- * you may not use this file except in compliance with the License.
360
- * You may obtain a copy of the License at
361
- *
362
- * https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12
363
- *
364
- * Unless required by applicable law or agreed to in writing, software
365
- * distributed under the License is distributed on an "AS IS" basis,
366
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
367
- * See the License for the specific language governing permissions and
368
- * limitations under the License.
369
- */
370
- class MilestoneSetEditComponent {
371
- constructor(milestoneService, formBuilder, router, alertService, route) {
372
- this.milestoneService = milestoneService;
373
- this.formBuilder = formBuilder;
374
- this.router = router;
375
- this.alertService = alertService;
376
- this.route = route;
377
- }
378
- get formControls() {
379
- return this.form.controls;
380
- }
381
- ngOnInit() {
382
- this.form = this.formBuilder.group({
383
- id: new FormControl({ value: '', disabled: true }, Validators.required),
384
- title: new FormControl({}, Validators.required),
385
- });
386
- this.getMilestoneSet();
387
- }
388
- reset() {
389
- this.form.controls.title.setValue('');
390
- }
391
- getMilestoneSet() {
392
- const milestoneSetId = this.route.snapshot.paramMap.get('id');
393
- this.milestoneService
394
- .getMilestoneSet(+milestoneSetId)
395
- .subscribe((milestoneSet) => {
396
- this.form.setValue({
397
- id: milestoneSet.id,
398
- title: milestoneSet.title,
399
- });
400
- });
401
- }
402
- delete() {
403
- // Todo: add confirmation dialog after it's fixed
404
- this.deleteMilestoneSet();
405
- }
406
- deleteMilestoneSet() {
407
- this.milestoneService.deleteMilestoneSet(this.form.getRawValue().id).subscribe(() => {
408
- this.router.navigate(['/milestones']);
409
- this.alertService.success('Milestone set has been deleted');
410
- }, err => {
411
- this.router.navigate(['/milestones']);
412
- this.alertService.error('Could not delete Milestone set. Make sure this Milestone set does not contain any milestones.');
413
- });
414
- }
415
- updateMilestoneSet() {
416
- this.milestoneService.updateMilestoneSet(this.form.getRawValue()).subscribe(() => {
417
- this.router.navigate(['/milestones']);
418
- this.alertService.success('Milestone set has been updated');
419
- });
420
- }
421
- }
422
- MilestoneSetEditComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: MilestoneSetEditComponent, deps: [{ token: MilestoneService }, { token: i2$1.FormBuilder }, { token: i3.Router }, { token: i4.AlertService }, { token: i3.ActivatedRoute }], target: i0.ɵɵFactoryTarget.Component });
423
- MilestoneSetEditComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "14.3.0", type: MilestoneSetEditComponent, selector: "valtimo-milestone-set-edit", ngImport: i0, template: "<!--\n ~ Copyright 2015-2023 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 class=\"card-body bg-light\">\n <div class=\"row py-5\">\n <div class=\"col-12\">\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\">{{ form.getRawValue().id }}</div>\n </div>\n </div>\n </div>\n </div>\n <div class=\"bg-white p-5\">\n <form [formGroup]=\"form\" (ngSubmit)=\"updateMilestoneSet()\">\n <div class=\"form-group row\">\n <label class=\"col-12 col-sm-3 col-form-label text-sm-right\" for=\"title\">Title</label>\n <div class=\"col-12 col-sm-8 col-lg-6\">\n <input\n type=\"text\"\n id=\"title\"\n formControlName=\"title\"\n class=\"form-control\"\n placeholder=\"Milestone set 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]=\"'/milestones'\" class=\"btn btn-space btn-default\">Back</a>\n <button type=\"button\" class=\"btn btn-space btn-danger\" (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 </valtimo-widget>\n </div>\n </div>\n</div>\n", styles: ["/*!\n * Copyright 2015-2023 Ritense BV, the Netherlands.\n *\n * Licensed under EUPL, Version 1.2 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" basis,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n"], dependencies: [{ kind: "directive", type: i3.RouterLinkWithHref, selector: "a[routerLink],area[routerLink]", inputs: ["target", "queryParams", "fragment", "queryParamsHandling", "state", "relativeTo", "preserveFragment", "skipLocationChange", "replaceUrl", "routerLink"] }, { kind: "directive", type: i6.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "directive", type: i6.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "component", type: i4.WidgetComponent, selector: "valtimo-widget", inputs: ["type", "name", "icon", "contrast", "divider", "title", "subtitle", "collapseAble", "collapse", "additionalClasses"] }, { kind: "directive", type: i2$1.ɵNgNoValidate, selector: "form:not([ngNoForm]):not([ngNativeValidate])" }, { kind: "directive", type: i2$1.DefaultValueAccessor, selector: "input:not([type=checkbox])[formControlName],textarea[formControlName],input:not([type=checkbox])[formControl],textarea[formControl],input:not([type=checkbox])[ngModel],textarea[ngModel],[ngDefaultControl]" }, { kind: "directive", type: i2$1.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i2$1.NgControlStatusGroup, selector: "[formGroupName],[formArrayName],[ngModelGroup],[formGroup],form:not([ngNoForm]),[ngForm]" }, { kind: "directive", type: i2$1.RequiredValidator, selector: ":not([type=checkbox])[required][formControlName],:not([type=checkbox])[required][formControl],:not([type=checkbox])[required][ngModel]", inputs: ["required"] }, { kind: "directive", type: i2$1.FormGroupDirective, selector: "[formGroup]", inputs: ["formGroup"], outputs: ["ngSubmit"], exportAs: ["ngForm"] }, { kind: "directive", type: i2$1.FormControlName, selector: "[formControlName]", inputs: ["formControlName", "disabled", "ngModel"], outputs: ["ngModelChange"] }] });
424
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: MilestoneSetEditComponent, decorators: [{
425
- type: Component,
426
- args: [{ selector: 'valtimo-milestone-set-edit', template: "<!--\n ~ Copyright 2015-2023 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 class=\"card-body bg-light\">\n <div class=\"row py-5\">\n <div class=\"col-12\">\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\">{{ form.getRawValue().id }}</div>\n </div>\n </div>\n </div>\n </div>\n <div class=\"bg-white p-5\">\n <form [formGroup]=\"form\" (ngSubmit)=\"updateMilestoneSet()\">\n <div class=\"form-group row\">\n <label class=\"col-12 col-sm-3 col-form-label text-sm-right\" for=\"title\">Title</label>\n <div class=\"col-12 col-sm-8 col-lg-6\">\n <input\n type=\"text\"\n id=\"title\"\n formControlName=\"title\"\n class=\"form-control\"\n placeholder=\"Milestone set 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]=\"'/milestones'\" class=\"btn btn-space btn-default\">Back</a>\n <button type=\"button\" class=\"btn btn-space btn-danger\" (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 </valtimo-widget>\n </div>\n </div>\n</div>\n", styles: ["/*!\n * Copyright 2015-2023 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"] }]
427
- }], ctorParameters: function () { return [{ type: MilestoneService }, { type: i2$1.FormBuilder }, { type: i3.Router }, { type: i4.AlertService }, { type: i3.ActivatedRoute }]; } });
428
-
429
- /*
430
- * Copyright 2015-2023 Ritense BV, the Netherlands.
431
- *
432
- * Licensed under EUPL, Version 1.2 (the "License");
433
- * you may not use this file except in compliance with the License.
434
- * You may obtain a copy of the License at
435
- *
436
- * https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12
437
- *
438
- * Unless required by applicable law or agreed to in writing, software
439
- * distributed under the License is distributed on an "AS IS" basis,
440
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
441
- * See the License for the specific language governing permissions and
442
- * limitations under the License.
443
- */
444
- class MilestoneEditComponent {
445
- constructor(milestoneService, formBuilder, router, alertService, processService, route) {
446
- this.milestoneService = milestoneService;
447
- this.formBuilder = formBuilder;
448
- this.router = router;
449
- this.alertService = alertService;
450
- this.processService = processService;
451
- this.route = route;
452
- this.milestoneSets = [];
453
- this.processDefinitions = [];
454
- this.taskDefinitions = [];
455
- }
456
- get formControls() {
457
- return this.form.controls;
458
- }
459
- ngOnInit() {
460
- this.form = this.formBuilder.group({
461
- id: new FormControl({ value: '', disabled: true }, Validators.required),
462
- milestoneSet: new FormControl('', Validators.required),
463
- title: new FormControl('', Validators.required),
464
- processDefinitionKey: new FormControl('', Validators.required),
465
- taskDefinitionKey: new FormControl('', Validators.required),
466
- plannedIntervalInDays: new FormControl('', [
467
- Validators.required,
468
- Validators.pattern('^[0-9]*$'),
469
- ]),
470
- color: new FormControl('', [
471
- Validators.required,
472
- Validators.pattern('^#([A-Fa-f0-9]{6}|[A-Fa-f0-9]{3})$'),
473
- ]),
474
- });
475
- this.getMilestone();
476
- this.getMilestoneSets();
477
- this.getProcessDefinitions();
478
- }
479
- reset() {
480
- this.form.patchValue({
481
- milestoneSet: '',
482
- title: '',
483
- processDefinitionKey: '',
484
- taskDefinitionKey: '',
485
- plannedIntervalInDays: '',
486
- color: '',
487
- });
488
- }
489
- getMilestone() {
490
- const milestoneId = this.route.snapshot.paramMap.get('id');
491
- this.milestoneService
492
- .getMilestone(+milestoneId)
493
- .pipe(switchMap((milestone) => {
494
- this.form.patchValue({
495
- id: milestone.id,
496
- milestoneSet: milestone.milestoneSet.id,
497
- title: milestone.title,
498
- plannedIntervalInDays: milestone.plannedIntervalInDays,
499
- color: milestone.color,
500
- taskDefinitionKey: milestone.taskDefinitionKey,
501
- });
502
- return this.processService.getProcessDefinition(milestone.processDefinitionKey);
503
- }))
504
- .subscribe((processDefinition) => {
505
- this.form.patchValue({
506
- processDefinitionKey: processDefinition,
507
- });
508
- });
509
- }
510
- compareProcessDefinitions(processDefinition1, processDefinition2) {
511
- return processDefinition1.id === processDefinition2.id;
512
- }
513
- getMilestoneSets() {
514
- this.milestoneService.getMilestoneSets().subscribe((milesetoneSets) => {
515
- this.milestoneSets = milesetoneSets;
516
- });
517
- }
518
- getProcessDefinitions() {
519
- this.processService
520
- .getProcessDefinitions()
521
- .subscribe((processDefinitions) => {
522
- this.processDefinitions = processDefinitions;
523
- });
524
- }
525
- getFlownodes(processDefinitionId) {
526
- if (processDefinitionId) {
527
- this.milestoneService.getFlownodes(processDefinitionId).subscribe((flowNodes) => {
528
- this.taskDefinitions = flowNodes['flowNodeMap'];
529
- });
530
- }
531
- }
532
- delete() {
533
- // Todo: add confirmation dialog after it's fixed
534
- this.deleteMilestone();
535
- }
536
- deleteMilestone() {
537
- this.milestoneService.deleteMilestone(this.form.getRawValue().id).subscribe(() => {
538
- this.router.navigate(['/milestones']);
539
- this.alertService.success('Milestone has been deleted');
540
- }, err => {
541
- this.router.navigate(['/milestones']);
542
- this.alertService.error('Could not delete Milestone');
543
- });
544
- }
545
- updateMilestone() {
546
- const milestone = this.form.getRawValue();
547
- milestone.processDefinitionKey = milestone.processDefinitionKey['key'];
548
- this.milestoneService.updateMilestone(milestone).subscribe(() => {
549
- this.router.navigate(['/milestones']);
550
- this.alertService.success('Milestone has been updated');
551
- }, err => {
552
- this.alertService.error('Error updating milestone');
553
- });
554
- }
555
- }
556
- MilestoneEditComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: MilestoneEditComponent, deps: [{ token: MilestoneService }, { token: i2$1.FormBuilder }, { token: i3.Router }, { token: i4.AlertService }, { token: i5.ProcessService }, { token: i3.ActivatedRoute }], target: i0.ɵɵFactoryTarget.Component });
557
- MilestoneEditComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "14.3.0", type: MilestoneEditComponent, selector: "valtimo-milestone-edit", ngImport: i0, template: "<!--\n ~ Copyright 2015-2023 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 class=\"card-body bg-light\">\n <div class=\"row py-5\">\n <div class=\"col-12\">\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\">{{ form.getRawValue().id }}</div>\n </div>\n </div>\n </div>\n </div>\n <div class=\"bg-white p-5\">\n <form [formGroup]=\"form\" (ngSubmit)=\"updateMilestone()\">\n <div class=\"form-group row\">\n <label class=\"col-12 col-sm-3 col-form-label text-sm-right\" for=\"title\"\n >Milestone set</label\n >\n <div class=\"col-12 col-sm-8 col-lg-6\">\n <select\n type=\"text\"\n id=\"milestoneSet\"\n formControlName=\"milestoneSet\"\n class=\"form-control\"\n [ngClass]=\"{\n 'is-valid':\n formControls.milestoneSet.touched && formControls.milestoneSet.valid,\n 'is-invalid':\n formControls.milestoneSet.touched && formControls.milestoneSet.errors\n }\"\n required\n >\n <option value=\"\" selected disabled>Choose a Milestone set</option>\n <option *ngFor=\"let milestoneSet of milestoneSets\" [value]=\"milestoneSet.id\">\n {{ milestoneSet.title }} ({{ milestoneSet.id }})\n </option>\n </select>\n <div\n *ngIf=\"formControls.milestoneSet.touched && formControls.milestoneSet.errors\"\n class=\"invalid-feedback\"\n >\n <div *ngIf=\"formControls.milestoneSet.errors.required\">\n Milestone set 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=\"title\">Title</label>\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=\"Milestone 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=\"form-group row\">\n <label class=\"col-12 col-sm-3 col-form-label text-sm-right\" for=\"process\"\n >Process definition</label\n >\n <div class=\"col-12 col-sm-8 col-lg-6\">\n <select\n type=\"text\"\n id=\"process\"\n formControlName=\"processDefinitionKey\"\n class=\"form-control\"\n (ngModelChange)=\"getFlownodes($event.id)\"\n [ngClass]=\"{\n 'is-valid':\n formControls.processDefinitionKey.touched &&\n formControls.processDefinitionKey.valid,\n 'is-invalid':\n formControls.processDefinitionKey.touched &&\n formControls.processDefinitionKey.errors\n }\"\n required\n [compareWith]=\"compareProcessDefinitions\"\n >\n <option value=\"\" disabled>Choose a process</option>\n <option\n *ngFor=\"let processDefinition of processDefinitions\"\n [ngValue]=\"processDefinition\"\n >\n {{ processDefinition.name }} ({{ processDefinition.key }})\n </option>\n </select>\n <div\n *ngIf=\"\n formControls.processDefinitionKey.touched &&\n formControls.processDefinitionKey.errors\n \"\n class=\"invalid-feedback\"\n >\n <div *ngIf=\"formControls.processDefinitionKey.errors.required\">\n Process 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=\"process\">Task</label>\n <div class=\"col-12 col-sm-8 col-lg-6\">\n <select\n type=\"text\"\n id=\"task\"\n formControlName=\"taskDefinitionKey\"\n class=\"form-control\"\n [ngClass]=\"{\n 'is-valid':\n formControls.taskDefinitionKey.touched &&\n formControls.taskDefinitionKey.valid,\n 'is-invalid':\n formControls.taskDefinitionKey.touched &&\n formControls.taskDefinitionKey.errors\n }\"\n required\n >\n <option value=\"\" disabled>Choose a task</option>\n <option\n *ngFor=\"let taskDefinition of taskDefinitions | keyvalue\"\n [value]=\"taskDefinition.key\"\n >\n {{ taskDefinition.value }} ({{ taskDefinition.key }})\n </option>\n </select>\n <div\n *ngIf=\"\n formControls.taskDefinitionKey.touched && formControls.taskDefinitionKey.errors\n \"\n class=\"invalid-feedback\"\n >\n <div *ngIf=\"formControls.taskDefinitionKey.errors.required\">Task 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=\"interval\"\n >Interval (in days)</label\n >\n <div class=\"col-12 col-sm-8 col-lg-6\">\n <input\n type=\"text\"\n id=\"interval\"\n formControlName=\"plannedIntervalInDays\"\n class=\"form-control\"\n placeholder=\"Interval (in days)\"\n [ngClass]=\"{\n 'is-valid':\n formControls.plannedIntervalInDays.touched &&\n formControls.plannedIntervalInDays.valid,\n 'is-invalid':\n formControls.plannedIntervalInDays.touched &&\n formControls.plannedIntervalInDays.errors\n }\"\n required\n />\n <div\n *ngIf=\"\n formControls.plannedIntervalInDays.touched &&\n formControls.plannedIntervalInDays.errors\n \"\n class=\"invalid-feedback\"\n >\n <div *ngIf=\"formControls.plannedIntervalInDays.errors.required\">\n Interval is required\n </div>\n <div *ngIf=\"formControls.plannedIntervalInDays.errors.pattern\">\n Interval is not a valid number\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=\"color\">Color</label>\n <div class=\"col-12 col-sm-8 col-lg-6\">\n <input\n [colorPicker]=\"form.value.color\"\n (colorPickerChange)=\"form.controls.color.setValue($event)\"\n [style.background]=\"form.value.color\"\n type=\"text\"\n id=\"color\"\n formControlName=\"color\"\n class=\"form-control\"\n placeholder=\"Color\"\n [ngClass]=\"{\n 'is-valid': formControls.color.touched && formControls.color.valid,\n 'is-invalid': formControls.color.touched && formControls.color.errors\n }\"\n required\n />\n <div\n *ngIf=\"formControls.color.touched && formControls.color.errors\"\n class=\"invalid-feedback\"\n >\n <div *ngIf=\"formControls.color.errors.required\">Color is required</div>\n <div *ngIf=\"formControls.color.errors.pattern\">Color is not a valid hex code</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]=\"'/milestones'\" class=\"btn btn-space btn-default\">Back</a>\n <button type=\"button\" class=\"btn btn-space btn-danger\" (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 </valtimo-widget>\n </div>\n </div>\n</div>\n", styles: ["/*!\n * Copyright 2015-2023 Ritense BV, the Netherlands.\n *\n * Licensed under EUPL, Version 1.2 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" basis,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n"], dependencies: [{ kind: "directive", type: i3.RouterLinkWithHref, selector: "a[routerLink],area[routerLink]", inputs: ["target", "queryParams", "fragment", "queryParamsHandling", "state", "relativeTo", "preserveFragment", "skipLocationChange", "replaceUrl", "routerLink"] }, { kind: "directive", type: i6.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "directive", type: i6.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "directive", type: i6.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "component", type: i4.WidgetComponent, selector: "valtimo-widget", inputs: ["type", "name", "icon", "contrast", "divider", "title", "subtitle", "collapseAble", "collapse", "additionalClasses"] }, { kind: "directive", type: i2$1.ɵNgNoValidate, selector: "form:not([ngNoForm]):not([ngNativeValidate])" }, { kind: "directive", type: i2$1.NgSelectOption, selector: "option", inputs: ["ngValue", "value"] }, { kind: "directive", type: i2$1.ɵNgSelectMultipleOption, selector: "option", inputs: ["ngValue", "value"] }, { kind: "directive", type: i2$1.DefaultValueAccessor, selector: "input:not([type=checkbox])[formControlName],textarea[formControlName],input:not([type=checkbox])[formControl],textarea[formControl],input:not([type=checkbox])[ngModel],textarea[ngModel],[ngDefaultControl]" }, { kind: "directive", type: i2$1.SelectControlValueAccessor, selector: "select:not([multiple])[formControlName],select:not([multiple])[formControl],select:not([multiple])[ngModel]", inputs: ["compareWith"] }, { kind: "directive", type: i2$1.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i2$1.NgControlStatusGroup, selector: "[formGroupName],[formArrayName],[ngModelGroup],[formGroup],form:not([ngNoForm]),[ngForm]" }, { kind: "directive", type: i2$1.RequiredValidator, selector: ":not([type=checkbox])[required][formControlName],:not([type=checkbox])[required][formControl],:not([type=checkbox])[required][ngModel]", inputs: ["required"] }, { kind: "directive", type: i2$1.FormGroupDirective, selector: "[formGroup]", inputs: ["formGroup"], outputs: ["ngSubmit"], exportAs: ["ngForm"] }, { kind: "directive", type: i2$1.FormControlName, selector: "[formControlName]", inputs: ["formControlName", "disabled", "ngModel"], outputs: ["ngModelChange"] }, { kind: "directive", type: i7.ColorPickerDirective, selector: "[colorPicker]", inputs: ["colorPicker", "cpWidth", "cpHeight", "cpToggle", "cpDisabled", "cpIgnoredElements", "cpFallbackColor", "cpColorMode", "cpCmykEnabled", "cpOutputFormat", "cpAlphaChannel", "cpDisableInput", "cpDialogDisplay", "cpSaveClickOutside", "cpCloseClickOutside", "cpUseRootViewContainer", "cpPosition", "cpPositionOffset", "cpPositionRelativeToArrow", "cpOKButton", "cpOKButtonText", "cpOKButtonClass", "cpCancelButton", "cpCancelButtonText", "cpCancelButtonClass", "cpEyeDropper", "cpPresetLabel", "cpPresetColors", "cpPresetColorsClass", "cpMaxPresetColorsLength", "cpPresetEmptyMessage", "cpPresetEmptyMessageClass", "cpAddColorButton", "cpAddColorButtonText", "cpAddColorButtonClass", "cpRemoveColorButtonClass", "cpExtraTemplate"], outputs: ["cpInputChange", "cpToggleChange", "cpSliderChange", "cpSliderDragEnd", "cpSliderDragStart", "colorPickerOpen", "colorPickerClose", "colorPickerCancel", "colorPickerSelect", "colorPickerChange", "cpCmykColorChange", "cpPresetColorsChange"], exportAs: ["ngxColorPicker"] }, { kind: "pipe", type: i6.KeyValuePipe, name: "keyvalue" }] });
558
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: MilestoneEditComponent, decorators: [{
559
- type: Component,
560
- args: [{ selector: 'valtimo-milestone-edit', template: "<!--\n ~ Copyright 2015-2023 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 class=\"card-body bg-light\">\n <div class=\"row py-5\">\n <div class=\"col-12\">\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\">{{ form.getRawValue().id }}</div>\n </div>\n </div>\n </div>\n </div>\n <div class=\"bg-white p-5\">\n <form [formGroup]=\"form\" (ngSubmit)=\"updateMilestone()\">\n <div class=\"form-group row\">\n <label class=\"col-12 col-sm-3 col-form-label text-sm-right\" for=\"title\"\n >Milestone set</label\n >\n <div class=\"col-12 col-sm-8 col-lg-6\">\n <select\n type=\"text\"\n id=\"milestoneSet\"\n formControlName=\"milestoneSet\"\n class=\"form-control\"\n [ngClass]=\"{\n 'is-valid':\n formControls.milestoneSet.touched && formControls.milestoneSet.valid,\n 'is-invalid':\n formControls.milestoneSet.touched && formControls.milestoneSet.errors\n }\"\n required\n >\n <option value=\"\" selected disabled>Choose a Milestone set</option>\n <option *ngFor=\"let milestoneSet of milestoneSets\" [value]=\"milestoneSet.id\">\n {{ milestoneSet.title }} ({{ milestoneSet.id }})\n </option>\n </select>\n <div\n *ngIf=\"formControls.milestoneSet.touched && formControls.milestoneSet.errors\"\n class=\"invalid-feedback\"\n >\n <div *ngIf=\"formControls.milestoneSet.errors.required\">\n Milestone set 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=\"title\">Title</label>\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=\"Milestone 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=\"form-group row\">\n <label class=\"col-12 col-sm-3 col-form-label text-sm-right\" for=\"process\"\n >Process definition</label\n >\n <div class=\"col-12 col-sm-8 col-lg-6\">\n <select\n type=\"text\"\n id=\"process\"\n formControlName=\"processDefinitionKey\"\n class=\"form-control\"\n (ngModelChange)=\"getFlownodes($event.id)\"\n [ngClass]=\"{\n 'is-valid':\n formControls.processDefinitionKey.touched &&\n formControls.processDefinitionKey.valid,\n 'is-invalid':\n formControls.processDefinitionKey.touched &&\n formControls.processDefinitionKey.errors\n }\"\n required\n [compareWith]=\"compareProcessDefinitions\"\n >\n <option value=\"\" disabled>Choose a process</option>\n <option\n *ngFor=\"let processDefinition of processDefinitions\"\n [ngValue]=\"processDefinition\"\n >\n {{ processDefinition.name }} ({{ processDefinition.key }})\n </option>\n </select>\n <div\n *ngIf=\"\n formControls.processDefinitionKey.touched &&\n formControls.processDefinitionKey.errors\n \"\n class=\"invalid-feedback\"\n >\n <div *ngIf=\"formControls.processDefinitionKey.errors.required\">\n Process 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=\"process\">Task</label>\n <div class=\"col-12 col-sm-8 col-lg-6\">\n <select\n type=\"text\"\n id=\"task\"\n formControlName=\"taskDefinitionKey\"\n class=\"form-control\"\n [ngClass]=\"{\n 'is-valid':\n formControls.taskDefinitionKey.touched &&\n formControls.taskDefinitionKey.valid,\n 'is-invalid':\n formControls.taskDefinitionKey.touched &&\n formControls.taskDefinitionKey.errors\n }\"\n required\n >\n <option value=\"\" disabled>Choose a task</option>\n <option\n *ngFor=\"let taskDefinition of taskDefinitions | keyvalue\"\n [value]=\"taskDefinition.key\"\n >\n {{ taskDefinition.value }} ({{ taskDefinition.key }})\n </option>\n </select>\n <div\n *ngIf=\"\n formControls.taskDefinitionKey.touched && formControls.taskDefinitionKey.errors\n \"\n class=\"invalid-feedback\"\n >\n <div *ngIf=\"formControls.taskDefinitionKey.errors.required\">Task 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=\"interval\"\n >Interval (in days)</label\n >\n <div class=\"col-12 col-sm-8 col-lg-6\">\n <input\n type=\"text\"\n id=\"interval\"\n formControlName=\"plannedIntervalInDays\"\n class=\"form-control\"\n placeholder=\"Interval (in days)\"\n [ngClass]=\"{\n 'is-valid':\n formControls.plannedIntervalInDays.touched &&\n formControls.plannedIntervalInDays.valid,\n 'is-invalid':\n formControls.plannedIntervalInDays.touched &&\n formControls.plannedIntervalInDays.errors\n }\"\n required\n />\n <div\n *ngIf=\"\n formControls.plannedIntervalInDays.touched &&\n formControls.plannedIntervalInDays.errors\n \"\n class=\"invalid-feedback\"\n >\n <div *ngIf=\"formControls.plannedIntervalInDays.errors.required\">\n Interval is required\n </div>\n <div *ngIf=\"formControls.plannedIntervalInDays.errors.pattern\">\n Interval is not a valid number\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=\"color\">Color</label>\n <div class=\"col-12 col-sm-8 col-lg-6\">\n <input\n [colorPicker]=\"form.value.color\"\n (colorPickerChange)=\"form.controls.color.setValue($event)\"\n [style.background]=\"form.value.color\"\n type=\"text\"\n id=\"color\"\n formControlName=\"color\"\n class=\"form-control\"\n placeholder=\"Color\"\n [ngClass]=\"{\n 'is-valid': formControls.color.touched && formControls.color.valid,\n 'is-invalid': formControls.color.touched && formControls.color.errors\n }\"\n required\n />\n <div\n *ngIf=\"formControls.color.touched && formControls.color.errors\"\n class=\"invalid-feedback\"\n >\n <div *ngIf=\"formControls.color.errors.required\">Color is required</div>\n <div *ngIf=\"formControls.color.errors.pattern\">Color is not a valid hex code</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]=\"'/milestones'\" class=\"btn btn-space btn-default\">Back</a>\n <button type=\"button\" class=\"btn btn-space btn-danger\" (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 </valtimo-widget>\n </div>\n </div>\n</div>\n", styles: ["/*!\n * Copyright 2015-2023 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"] }]
561
- }], ctorParameters: function () { return [{ type: MilestoneService }, { type: i2$1.FormBuilder }, { type: i3.Router }, { type: i4.AlertService }, { type: i5.ProcessService }, { type: i3.ActivatedRoute }]; } });
562
-
563
- /*
564
- * Copyright 2015-2023 Ritense BV, the Netherlands.
565
- *
566
- * Licensed under EUPL, Version 1.2 (the "License");
567
- * you may not use this file except in compliance with the License.
568
- * You may obtain a copy of the License at
569
- *
570
- * https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12
571
- *
572
- * Unless required by applicable law or agreed to in writing, software
573
- * distributed under the License is distributed on an "AS IS" basis,
574
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
575
- * See the License for the specific language governing permissions and
576
- * limitations under the License.
577
- */
578
- const routes = [
579
- {
580
- path: 'milestones',
581
- component: MilestoneComponent,
582
- canActivate: [AuthGuardService],
583
- data: { title: 'Milestones', roles: [ROLE_ADMIN] },
584
- },
585
- {
586
- path: 'milestones/sets/create',
587
- component: MilestoneSetCreateComponent,
588
- canActivate: [AuthGuardService],
589
- data: { title: 'Create new Milestone Set', roles: [ROLE_ADMIN] },
590
- },
591
- {
592
- path: 'milestones/create',
593
- component: MilestoneCreateComponent,
594
- canActivate: [AuthGuardService],
595
- data: { title: 'Create new Milestone', roles: [ROLE_ADMIN] },
596
- },
597
- {
598
- path: 'milestones/sets/set/:id',
599
- component: MilestoneSetEditComponent,
600
- canActivate: [AuthGuardService],
601
- data: { title: 'Milestone Set details', roles: [ROLE_ADMIN] },
602
- },
603
- {
604
- path: 'milestones/milestone/:id',
605
- component: MilestoneEditComponent,
606
- canActivate: [AuthGuardService],
607
- data: { title: 'Milestone details', roles: [ROLE_ADMIN] },
608
- },
609
- ];
610
- class MilestoneRoutingModule {
611
- }
612
- MilestoneRoutingModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: MilestoneRoutingModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
613
- MilestoneRoutingModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "14.3.0", ngImport: i0, type: MilestoneRoutingModule, imports: [CommonModule, i3.RouterModule], exports: [RouterModule] });
614
- MilestoneRoutingModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: MilestoneRoutingModule, imports: [CommonModule, RouterModule.forChild(routes), RouterModule] });
615
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: MilestoneRoutingModule, decorators: [{
616
- type: NgModule,
617
- args: [{
618
- declarations: [],
619
- imports: [CommonModule, RouterModule.forChild(routes)],
620
- exports: [RouterModule],
621
- }]
622
- }] });
623
-
624
- /*
625
- * Copyright 2015-2023 Ritense BV, the Netherlands.
626
- *
627
- * Licensed under EUPL, Version 1.2 (the "License");
628
- * you may not use this file except in compliance with the License.
629
- * You may obtain a copy of the License at
630
- *
631
- * https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12
632
- *
633
- * Unless required by applicable law or agreed to in writing, software
634
- * distributed under the License is distributed on an "AS IS" basis,
635
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
636
- * See the License for the specific language governing permissions and
637
- * limitations under the License.
638
- */
639
- class MilestoneModule {
640
- }
641
- MilestoneModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: MilestoneModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
642
- MilestoneModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "14.3.0", ngImport: i0, type: MilestoneModule, declarations: [MilestoneComponent,
643
- MilestoneSetCreateComponent,
644
- MilestoneListComponent,
645
- MilestoneCreateComponent,
646
- MilestoneEditComponent,
647
- MilestoneSetEditComponent], imports: [RouterModule,
648
- MilestoneRoutingModule,
649
- CommonModule,
650
- ListModule,
651
- WidgetModule,
652
- ReactiveFormsModule,
653
- ColorPickerModule,
654
- TranslateModule], exports: [MilestoneComponent] });
655
- MilestoneModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: MilestoneModule, imports: [RouterModule,
656
- MilestoneRoutingModule,
657
- CommonModule,
658
- ListModule,
659
- WidgetModule,
660
- ReactiveFormsModule,
661
- ColorPickerModule,
662
- TranslateModule] });
663
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: MilestoneModule, decorators: [{
664
- type: NgModule,
665
- args: [{
666
- declarations: [
667
- MilestoneComponent,
668
- MilestoneSetCreateComponent,
669
- MilestoneListComponent,
670
- MilestoneCreateComponent,
671
- MilestoneEditComponent,
672
- MilestoneSetEditComponent,
673
- ],
674
- imports: [
675
- RouterModule,
676
- MilestoneRoutingModule,
677
- CommonModule,
678
- ListModule,
679
- WidgetModule,
680
- ReactiveFormsModule,
681
- ColorPickerModule,
682
- TranslateModule,
683
- ],
684
- exports: [MilestoneComponent],
685
- }]
686
- }] });
687
-
688
- /*
689
- * Copyright 2015-2023 Ritense BV, the Netherlands.
690
- *
691
- * Licensed under EUPL, Version 1.2 (the "License");
692
- * you may not use this file except in compliance with the License.
693
- * You may obtain a copy of the License at
694
- *
695
- * https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12
696
- *
697
- * Unless required by applicable law or agreed to in writing, software
698
- * distributed under the License is distributed on an "AS IS" basis,
699
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
700
- * See the License for the specific language governing permissions and
701
- * limitations under the License.
702
- */
703
-
704
- /**
705
- * Generated bundle index. Do not edit.
706
- */
707
-
708
- export { MilestoneComponent, MilestoneModule, MilestoneService };
709
- //# sourceMappingURL=valtimo-milestone.mjs.map