@valtimo/milestone 4.21.0 → 5.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 (68) hide show
  1. package/esm2020/lib/milestone-create/milestone-create.component.mjs +106 -0
  2. package/esm2020/lib/milestone-edit/milestone-edit.component.mjs +145 -0
  3. package/esm2020/lib/milestone-list/milestone-list.component.mjs +88 -0
  4. package/esm2020/lib/milestone-routing.module.mjs +73 -0
  5. package/esm2020/lib/milestone-set-create/milestone-set-create.component.mjs +57 -0
  6. package/esm2020/lib/milestone-set-edit/milestone-set-edit.component.mjs +82 -0
  7. package/esm2020/lib/milestone.component.mjs +31 -0
  8. package/esm2020/lib/milestone.module.mjs +81 -0
  9. package/esm2020/lib/milestone.service.mjs +68 -0
  10. package/esm2020/lib/models/index.mjs +20 -0
  11. package/esm2020/lib/models/milestone-set.model.mjs +17 -0
  12. package/esm2020/lib/models/milestone.model.mjs +17 -0
  13. package/esm2020/public-api.mjs +23 -0
  14. package/esm2020/valtimo-milestone.mjs +5 -0
  15. package/fesm2015/valtimo-milestone.mjs +713 -0
  16. package/fesm2015/valtimo-milestone.mjs.map +1 -0
  17. package/fesm2020/valtimo-milestone.mjs +745 -0
  18. package/fesm2020/valtimo-milestone.mjs.map +1 -0
  19. package/lib/milestone-create/milestone-create.component.d.ts +4 -0
  20. package/lib/milestone-create/milestone-create.component.d.ts.map +1 -0
  21. package/lib/milestone-edit/milestone-edit.component.d.ts +4 -0
  22. package/lib/milestone-edit/milestone-edit.component.d.ts.map +1 -0
  23. package/lib/milestone-list/milestone-list.component.d.ts +4 -0
  24. package/lib/milestone-list/milestone-list.component.d.ts.map +1 -0
  25. package/lib/milestone-routing.module.d.ts +7 -0
  26. package/lib/milestone-routing.module.d.ts.map +1 -0
  27. package/lib/milestone-set-create/milestone-set-create.component.d.ts +4 -0
  28. package/lib/milestone-set-create/milestone-set-create.component.d.ts.map +1 -0
  29. package/lib/milestone-set-edit/milestone-set-edit.component.d.ts +4 -0
  30. package/lib/milestone-set-edit/milestone-set-edit.component.d.ts.map +1 -0
  31. package/lib/milestone.component.d.ts +4 -0
  32. package/lib/milestone.component.d.ts.map +1 -0
  33. package/lib/milestone.module.d.ts +18 -0
  34. package/lib/milestone.module.d.ts.map +1 -0
  35. package/lib/milestone.service.d.ts +4 -0
  36. package/lib/milestone.service.d.ts.map +1 -0
  37. package/lib/models/index.d.ts +1 -0
  38. package/lib/models/index.d.ts.map +1 -0
  39. package/lib/models/milestone-set.model.d.ts +1 -0
  40. package/lib/models/milestone-set.model.d.ts.map +1 -0
  41. package/lib/models/milestone.model.d.ts +1 -0
  42. package/lib/models/milestone.model.d.ts.map +1 -0
  43. package/package.json +22 -10
  44. package/public-api.d.ts +1 -0
  45. package/public-api.d.ts.map +1 -0
  46. package/valtimo-milestone.d.ts +2 -6
  47. package/valtimo-milestone.d.ts.map +1 -0
  48. package/bundles/valtimo-milestone.umd.js +0 -1105
  49. package/bundles/valtimo-milestone.umd.js.map +0 -1
  50. package/bundles/valtimo-milestone.umd.min.js +0 -2
  51. package/bundles/valtimo-milestone.umd.min.js.map +0 -1
  52. package/esm2015/lib/milestone-create/milestone-create.component.js +0 -110
  53. package/esm2015/lib/milestone-edit/milestone-edit.component.js +0 -150
  54. package/esm2015/lib/milestone-list/milestone-list.component.js +0 -90
  55. package/esm2015/lib/milestone-routing.module.js +0 -69
  56. package/esm2015/lib/milestone-set-create/milestone-set-create.component.js +0 -61
  57. package/esm2015/lib/milestone-set-edit/milestone-set-edit.component.js +0 -87
  58. package/esm2015/lib/milestone.component.js +0 -29
  59. package/esm2015/lib/milestone.module.js +0 -55
  60. package/esm2015/lib/milestone.service.js +0 -72
  61. package/esm2015/lib/models/index.js +0 -20
  62. package/esm2015/lib/models/milestone-set.model.js +0 -16
  63. package/esm2015/lib/models/milestone.model.js +0 -16
  64. package/esm2015/public-api.js +0 -23
  65. package/esm2015/valtimo-milestone.js +0 -11
  66. package/fesm2015/valtimo-milestone.js +0 -750
  67. package/fesm2015/valtimo-milestone.js.map +0 -1
  68. package/valtimo-milestone.metadata.json +0 -1
@@ -1,750 +0,0 @@
1
- import { ɵɵdefineInjectable, ɵɵinject, Injectable, Component, NgModule } from '@angular/core';
2
- import { HttpClient } from '@angular/common/http';
3
- import { ConfigService, ROLE_ADMIN } from '@valtimo/config';
4
- import { FormControl, Validators, FormBuilder, ReactiveFormsModule } from '@angular/forms';
5
- import { AlertService, ListModule, WidgetModule } from '@valtimo/components';
6
- import { Router, ActivatedRoute, RouterModule } from '@angular/router';
7
- import { CommonModule } from '@angular/common';
8
- import { AuthGuardService } from '@valtimo/security';
9
- import { ProcessService } from '@valtimo/process';
10
- import { switchMap } from 'rxjs/operators';
11
- import { combineLatest } from 'rxjs';
12
- import { ColorPickerModule } from 'ngx-color-picker';
13
- import { TranslateModule } from '@ngx-translate/core';
14
-
15
- /*
16
- * Copyright 2015-2020 Ritense BV, the Netherlands.
17
- *
18
- * Licensed under EUPL, Version 1.2 (the "License");
19
- * you may not use this file except in compliance with the License.
20
- * You may obtain a copy of the License at
21
- *
22
- * https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12
23
- *
24
- * Unless required by applicable law or agreed to in writing, software
25
- * distributed under the License is distributed on an "AS IS" basis,
26
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
27
- * See the License for the specific language governing permissions and
28
- * limitations under the License.
29
- */
30
-
31
- /*
32
- * Copyright 2015-2020 Ritense BV, the Netherlands.
33
- *
34
- * Licensed under EUPL, Version 1.2 (the "License");
35
- * you may not use this file except in compliance with the License.
36
- * You may obtain a copy of the License at
37
- *
38
- * https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12
39
- *
40
- * Unless required by applicable law or agreed to in writing, software
41
- * distributed under the License is distributed on an "AS IS" basis,
42
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
43
- * See the License for the specific language governing permissions and
44
- * limitations under the License.
45
- */
46
-
47
- /*
48
- *
49
- * * Copyright 2015-2020 Ritense BV, the Netherlands.
50
- * *
51
- * * Licensed under EUPL, Version 1.2 (the "License");
52
- * * you may not use this file except in compliance with the License.
53
- * * You may obtain a copy of the License at
54
- * *
55
- * * https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12
56
- * *
57
- * * Unless required by applicable law or agreed to in writing, software
58
- * * distributed under the License is distributed on an "AS IS" basis,
59
- * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
60
- * * See the License for the specific language governing permissions and
61
- * * limitations under the License.
62
- *
63
- */
64
-
65
- /*
66
- * Copyright 2015-2020 Ritense BV, the Netherlands.
67
- *
68
- * Licensed under EUPL, Version 1.2 (the "License");
69
- * you may not use this file except in compliance with the License.
70
- * You may obtain a copy of the License at
71
- *
72
- * https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12
73
- *
74
- * Unless required by applicable law or agreed to in writing, software
75
- * distributed under the License is distributed on an "AS IS" basis,
76
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
77
- * See the License for the specific language governing permissions and
78
- * limitations under the License.
79
- */
80
- class MilestoneService {
81
- constructor(configService, http) {
82
- this.configService = configService;
83
- this.http = http;
84
- this.valtimoApiConfig = configService.config.valtimoApi;
85
- }
86
- getMilestones() {
87
- return this.http.get(`${this.valtimoApiConfig.endpointUri}milestones`);
88
- }
89
- getMilestone(milestoneId) {
90
- return this.http.get(`${this.valtimoApiConfig.endpointUri}milestones/${milestoneId}`);
91
- }
92
- createMilestone(milestone) {
93
- return this.http.post(`${this.valtimoApiConfig.endpointUri}milestones`, milestone);
94
- }
95
- updateMilestone(milestone) {
96
- return this.http.post(`${this.valtimoApiConfig.endpointUri}milestones`, milestone);
97
- }
98
- deleteMilestone(milestoneId) {
99
- return this.http.delete(`${this.valtimoApiConfig.endpointUri}milestones/${milestoneId}`);
100
- }
101
- getMilestoneSets() {
102
- return this.http.get(`${this.valtimoApiConfig.endpointUri}milestone-sets`);
103
- }
104
- getMilestoneSet(milestoneSetId) {
105
- return this.http.get(`${this.valtimoApiConfig.endpointUri}milestone-sets/${milestoneSetId}`);
106
- }
107
- createMilestoneSet(milestoneSet) {
108
- return this.http.post(`${this.valtimoApiConfig.endpointUri}milestone-sets`, milestoneSet);
109
- }
110
- updateMilestoneSet(milestoneSet) {
111
- return this.http.post(`${this.valtimoApiConfig.endpointUri}milestone-sets`, milestoneSet);
112
- }
113
- deleteMilestoneSet(milestoneSetId) {
114
- return this.http.delete(`${this.valtimoApiConfig.endpointUri}milestone-sets/${milestoneSetId}`);
115
- }
116
- getFlownodes(processDefinitionId) {
117
- return this.http.get(`${this.valtimoApiConfig.endpointUri}milestones/${processDefinitionId}/flownodes`);
118
- }
119
- }
120
- MilestoneService.ɵprov = ɵɵdefineInjectable({ factory: function MilestoneService_Factory() { return new MilestoneService(ɵɵinject(ConfigService), ɵɵinject(HttpClient)); }, token: MilestoneService, providedIn: "root" });
121
- MilestoneService.decorators = [
122
- { type: Injectable, args: [{
123
- providedIn: 'root',
124
- },] }
125
- ];
126
- MilestoneService.ctorParameters = () => [
127
- { type: ConfigService },
128
- { type: HttpClient }
129
- ];
130
-
131
- /*
132
- * Copyright 2015-2020 Ritense BV, the Netherlands.
133
- *
134
- * Licensed under EUPL, Version 1.2 (the "License");
135
- * you may not use this file except in compliance with the License.
136
- * You may obtain a copy of the License at
137
- *
138
- * https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12
139
- *
140
- * Unless required by applicable law or agreed to in writing, software
141
- * distributed under the License is distributed on an "AS IS" basis,
142
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
143
- * See the License for the specific language governing permissions and
144
- * limitations under the License.
145
- */
146
- class MilestoneComponent {
147
- constructor() { }
148
- ngOnInit() { }
149
- }
150
- MilestoneComponent.decorators = [
151
- { type: Component, args: [{
152
- selector: 'valtimo-milestone',
153
- template: "<!--\n ~ Copyright 2015-2020 Ritense BV, the Netherlands.\n ~\n ~ Licensed under EUPL, Version 1.2 (the \"License\");\n ~ you may not use this file except in compliance with the License.\n ~ You may obtain a copy of the License at\n ~\n ~ https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12\n ~\n ~ Unless required by applicable law or agreed to in writing, software\n ~ distributed under the License is distributed on an \"AS IS\" basis,\n ~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n ~ See the License for the specific language governing permissions and\n ~ limitations under the License.\n -->\n\n<div class=\"main-content pt-0\">\n <div class=\"container-fluid\">\n <div class=\"text-right\">\n <div class=\"btn-group mt-m3px mb-3\">\n <button [routerLink]=\"'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",
154
- styles: ["/*!\n * Copyright 2015-2020 Ritense BV, the Netherlands.\n *\n * Licensed under EUPL, Version 1.2 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" basis,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */"]
155
- },] }
156
- ];
157
- MilestoneComponent.ctorParameters = () => [];
158
-
159
- /*
160
- * Copyright 2015-2020 Ritense BV, the Netherlands.
161
- *
162
- * Licensed under EUPL, Version 1.2 (the "License");
163
- * you may not use this file except in compliance with the License.
164
- * You may obtain a copy of the License at
165
- *
166
- * https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12
167
- *
168
- * Unless required by applicable law or agreed to in writing, software
169
- * distributed under the License is distributed on an "AS IS" basis,
170
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
171
- * See the License for the specific language governing permissions and
172
- * limitations under the License.
173
- */
174
- class MilestoneSetCreateComponent {
175
- constructor(milestoneService, formBuilder, router, alertService) {
176
- this.milestoneService = milestoneService;
177
- this.formBuilder = formBuilder;
178
- this.router = router;
179
- this.alertService = alertService;
180
- }
181
- get formControls() {
182
- return this.form.controls;
183
- }
184
- ngOnInit() {
185
- this.form = this.formBuilder.group({
186
- title: new FormControl('', Validators.required),
187
- });
188
- }
189
- reset() {
190
- this.form.setValue({
191
- title: '',
192
- });
193
- }
194
- createMilestoneSet() {
195
- this.milestoneService.createMilestoneSet(this.form.value).subscribe(() => {
196
- this.router.navigate(['/milestones']);
197
- this.alertService.success('New Milestone set has been created');
198
- });
199
- }
200
- }
201
- MilestoneSetCreateComponent.decorators = [
202
- { type: Component, args: [{
203
- selector: 'valtimo-milestone-set-create',
204
- template: "<!--\n ~ Copyright 2015-2020 Ritense BV, the Netherlands.\n ~\n ~ Licensed under EUPL, Version 1.2 (the \"License\");\n ~ you may not use this file except in compliance with the License.\n ~ You may obtain a copy of the License at\n ~\n ~ https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12\n ~\n ~ Unless required by applicable law or agreed to in writing, software\n ~ distributed under the License is distributed on an \"AS IS\" basis,\n ~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n ~ See the License for the specific language governing permissions and\n ~ limitations under the License.\n -->\n\n<div class=\"main-content\">\n <div class=\"container-fluid\">\n <div class=\"col-12 px-0 mb-5\">\n <valtimo-widget>\n <div 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",
205
- styles: ["/*!\n * Copyright 2015-2020 Ritense BV, the Netherlands.\n *\n * Licensed under EUPL, Version 1.2 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" basis,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */"]
206
- },] }
207
- ];
208
- MilestoneSetCreateComponent.ctorParameters = () => [
209
- { type: MilestoneService },
210
- { type: FormBuilder },
211
- { type: Router },
212
- { type: AlertService }
213
- ];
214
-
215
- /*
216
- * Copyright 2015-2020 Ritense BV, the Netherlands.
217
- *
218
- * Licensed under EUPL, Version 1.2 (the "License");
219
- * you may not use this file except in compliance with the License.
220
- * You may obtain a copy of the License at
221
- *
222
- * https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12
223
- *
224
- * Unless required by applicable law or agreed to in writing, software
225
- * distributed under the License is distributed on an "AS IS" basis,
226
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
227
- * See the License for the specific language governing permissions and
228
- * limitations under the License.
229
- */
230
- class MilestoneCreateComponent {
231
- constructor(milestoneService, formBuilder, router, alertService, processService) {
232
- this.milestoneService = milestoneService;
233
- this.formBuilder = formBuilder;
234
- this.router = router;
235
- this.alertService = alertService;
236
- this.processService = processService;
237
- this.milestoneSets = [];
238
- this.processDefinitions = [];
239
- this.taskDefinitions = [];
240
- }
241
- get formControls() {
242
- return this.form.controls;
243
- }
244
- ngOnInit() {
245
- this.form = this.formBuilder.group({
246
- milestoneSet: new FormControl('', Validators.required),
247
- title: new FormControl('', Validators.required),
248
- processDefinitionKey: new FormControl('', Validators.required),
249
- taskDefinitionKey: new FormControl('', Validators.required),
250
- plannedIntervalInDays: new FormControl('', [
251
- Validators.required,
252
- Validators.pattern('^[0-9]*$'),
253
- ]),
254
- color: new FormControl('', [
255
- Validators.required,
256
- Validators.pattern('^#([A-Fa-f0-9]{6}|[A-Fa-f0-9]{3})$'),
257
- ]),
258
- });
259
- this.getMilestoneSets();
260
- this.getMilestones();
261
- }
262
- reset() {
263
- this.form.patchValue({
264
- milestoneSet: '',
265
- title: '',
266
- processDefinitionKey: '',
267
- taskDefinitionKey: '',
268
- plannedIntervalInDays: '',
269
- color: '',
270
- });
271
- }
272
- getMilestoneSets() {
273
- this.milestoneService.getMilestoneSets().subscribe((milesetoneSets) => {
274
- this.milestoneSets = milesetoneSets;
275
- });
276
- }
277
- getMilestones() {
278
- this.processService
279
- .getProcessDefinitions()
280
- .subscribe((processDefinitions) => {
281
- this.processDefinitions = processDefinitions;
282
- });
283
- }
284
- getFlownodes(processDefinitionId) {
285
- if (processDefinitionId) {
286
- this.milestoneService.getFlownodes(processDefinitionId).subscribe((flowNodes) => {
287
- this.taskDefinitions = flowNodes['flowNodeMap'];
288
- this.form.controls.taskDefinitionKey.setValue('');
289
- });
290
- }
291
- }
292
- createMilestone() {
293
- const milestone = this.form.value;
294
- milestone.processDefinitionKey = milestone.processDefinitionKey['key'];
295
- milestone.id = null;
296
- this.milestoneService.createMilestone(milestone).subscribe(() => {
297
- this.router.navigate(['/milestones']);
298
- this.alertService.success('New Milestone has been created');
299
- }, err => {
300
- this.alertService.error('Error creating new milestone');
301
- });
302
- }
303
- }
304
- MilestoneCreateComponent.decorators = [
305
- { type: Component, args: [{
306
- selector: 'valtimo-milestone-create',
307
- template: "<!--\n ~ Copyright 2015-2020 Ritense BV, the Netherlands.\n ~\n ~ Licensed under EUPL, Version 1.2 (the \"License\");\n ~ you may not use this file except in compliance with the License.\n ~ You may obtain a copy of the License at\n ~\n ~ https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12\n ~\n ~ Unless required by applicable law or agreed to in writing, software\n ~ distributed under the License is distributed on an \"AS IS\" basis,\n ~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n ~ See the License for the specific language governing permissions and\n ~ limitations under the License.\n -->\n\n<div class=\"main-content\">\n <div class=\"container-fluid\">\n <div class=\"col-12 px-0 mb-5\">\n <valtimo-widget>\n <div 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",
308
- styles: ["/*!\n * Copyright 2015-2020 Ritense BV, the Netherlands.\n *\n * Licensed under EUPL, Version 1.2 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" basis,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */"]
309
- },] }
310
- ];
311
- MilestoneCreateComponent.ctorParameters = () => [
312
- { type: MilestoneService },
313
- { type: FormBuilder },
314
- { type: Router },
315
- { type: AlertService },
316
- { type: ProcessService }
317
- ];
318
-
319
- /*
320
- * Copyright 2015-2020 Ritense BV, the Netherlands.
321
- *
322
- * Licensed under EUPL, Version 1.2 (the "License");
323
- * you may not use this file except in compliance with the License.
324
- * You may obtain a copy of the License at
325
- *
326
- * https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12
327
- *
328
- * Unless required by applicable law or agreed to in writing, software
329
- * distributed under the License is distributed on an "AS IS" basis,
330
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
331
- * See the License for the specific language governing permissions and
332
- * limitations under the License.
333
- */
334
- class MilestoneSetEditComponent {
335
- constructor(milestoneService, formBuilder, router, alertService, route) {
336
- this.milestoneService = milestoneService;
337
- this.formBuilder = formBuilder;
338
- this.router = router;
339
- this.alertService = alertService;
340
- this.route = route;
341
- }
342
- get formControls() {
343
- return this.form.controls;
344
- }
345
- ngOnInit() {
346
- this.form = this.formBuilder.group({
347
- id: new FormControl({ value: '', disabled: true }, Validators.required),
348
- title: new FormControl({}, Validators.required),
349
- });
350
- this.getMilestoneSet();
351
- }
352
- reset() {
353
- this.form.controls.title.setValue('');
354
- }
355
- getMilestoneSet() {
356
- const milestoneSetId = this.route.snapshot.paramMap.get('id');
357
- this.milestoneService
358
- .getMilestoneSet(+milestoneSetId)
359
- .subscribe((milestoneSet) => {
360
- this.form.setValue({
361
- id: milestoneSet.id,
362
- title: milestoneSet.title,
363
- });
364
- });
365
- }
366
- delete() {
367
- // Todo: add confirmation dialog after it's fixed
368
- this.deleteMilestoneSet();
369
- }
370
- deleteMilestoneSet() {
371
- this.milestoneService.deleteMilestoneSet(this.form.getRawValue().id).subscribe(() => {
372
- this.router.navigate(['/milestones']);
373
- this.alertService.success('Milestone set has been deleted');
374
- }, err => {
375
- this.router.navigate(['/milestones']);
376
- this.alertService.error('Could not delete Milestone set. Make sure this Milestone set does not contain any milestones.');
377
- });
378
- }
379
- updateMilestoneSet() {
380
- this.milestoneService.updateMilestoneSet(this.form.getRawValue()).subscribe(() => {
381
- this.router.navigate(['/milestones']);
382
- this.alertService.success('Milestone set has been updated');
383
- });
384
- }
385
- }
386
- MilestoneSetEditComponent.decorators = [
387
- { type: Component, args: [{
388
- selector: 'valtimo-milestone-set-edit',
389
- template: "<!--\n ~ Copyright 2015-2020 Ritense BV, the Netherlands.\n ~\n ~ Licensed under EUPL, Version 1.2 (the \"License\");\n ~ you may not use this file except in compliance with the License.\n ~ You may obtain a copy of the License at\n ~\n ~ https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12\n ~\n ~ Unless required by applicable law or agreed to in writing, software\n ~ distributed under the License is distributed on an \"AS IS\" basis,\n ~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n ~ See the License for the specific language governing permissions and\n ~ limitations under the License.\n -->\n\n<div class=\"main-content\">\n <div class=\"container-fluid\">\n <div class=\"col-12 px-0 mb-5\">\n <valtimo-widget>\n <div 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",
390
- styles: ["/*!\n * Copyright 2015-2020 Ritense BV, the Netherlands.\n *\n * Licensed under EUPL, Version 1.2 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" basis,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */"]
391
- },] }
392
- ];
393
- MilestoneSetEditComponent.ctorParameters = () => [
394
- { type: MilestoneService },
395
- { type: FormBuilder },
396
- { type: Router },
397
- { type: AlertService },
398
- { type: ActivatedRoute }
399
- ];
400
-
401
- /*
402
- * Copyright 2015-2020 Ritense BV, the Netherlands.
403
- *
404
- * Licensed under EUPL, Version 1.2 (the "License");
405
- * you may not use this file except in compliance with the License.
406
- * You may obtain a copy of the License at
407
- *
408
- * https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12
409
- *
410
- * Unless required by applicable law or agreed to in writing, software
411
- * distributed under the License is distributed on an "AS IS" basis,
412
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
413
- * See the License for the specific language governing permissions and
414
- * limitations under the License.
415
- */
416
- class MilestoneEditComponent {
417
- constructor(milestoneService, formBuilder, router, alertService, processService, route) {
418
- this.milestoneService = milestoneService;
419
- this.formBuilder = formBuilder;
420
- this.router = router;
421
- this.alertService = alertService;
422
- this.processService = processService;
423
- this.route = route;
424
- this.milestoneSets = [];
425
- this.processDefinitions = [];
426
- this.taskDefinitions = [];
427
- }
428
- get formControls() {
429
- return this.form.controls;
430
- }
431
- ngOnInit() {
432
- this.form = this.formBuilder.group({
433
- id: new FormControl({ value: '', disabled: true }, Validators.required),
434
- milestoneSet: new FormControl('', Validators.required),
435
- title: new FormControl('', Validators.required),
436
- processDefinitionKey: new FormControl('', Validators.required),
437
- taskDefinitionKey: new FormControl('', Validators.required),
438
- plannedIntervalInDays: new FormControl('', [
439
- Validators.required,
440
- Validators.pattern('^[0-9]*$'),
441
- ]),
442
- color: new FormControl('', [
443
- Validators.required,
444
- Validators.pattern('^#([A-Fa-f0-9]{6}|[A-Fa-f0-9]{3})$'),
445
- ]),
446
- });
447
- this.getMilestone();
448
- this.getMilestoneSets();
449
- this.getProcessDefinitions();
450
- }
451
- reset() {
452
- this.form.patchValue({
453
- milestoneSet: '',
454
- title: '',
455
- processDefinitionKey: '',
456
- taskDefinitionKey: '',
457
- plannedIntervalInDays: '',
458
- color: '',
459
- });
460
- }
461
- getMilestone() {
462
- const milestoneId = this.route.snapshot.paramMap.get('id');
463
- this.milestoneService
464
- .getMilestone(+milestoneId)
465
- .pipe(switchMap((milestone) => {
466
- this.form.patchValue({
467
- id: milestone.id,
468
- milestoneSet: milestone.milestoneSet.id,
469
- title: milestone.title,
470
- plannedIntervalInDays: milestone.plannedIntervalInDays,
471
- color: milestone.color,
472
- taskDefinitionKey: milestone.taskDefinitionKey,
473
- });
474
- return this.processService.getProcessDefinition(milestone.processDefinitionKey);
475
- }))
476
- .subscribe((processDefinition) => {
477
- this.form.patchValue({
478
- processDefinitionKey: processDefinition,
479
- });
480
- });
481
- }
482
- compareProcessDefinitions(processDefinition1, processDefinition2) {
483
- return processDefinition1.id === processDefinition2.id;
484
- }
485
- getMilestoneSets() {
486
- this.milestoneService.getMilestoneSets().subscribe((milesetoneSets) => {
487
- this.milestoneSets = milesetoneSets;
488
- });
489
- }
490
- getProcessDefinitions() {
491
- this.processService
492
- .getProcessDefinitions()
493
- .subscribe((processDefinitions) => {
494
- this.processDefinitions = processDefinitions;
495
- });
496
- }
497
- getFlownodes(processDefinitionId) {
498
- if (processDefinitionId) {
499
- this.milestoneService.getFlownodes(processDefinitionId).subscribe((flowNodes) => {
500
- this.taskDefinitions = flowNodes['flowNodeMap'];
501
- });
502
- }
503
- }
504
- delete() {
505
- // Todo: add confirmation dialog after it's fixed
506
- this.deleteMilestone();
507
- }
508
- deleteMilestone() {
509
- this.milestoneService.deleteMilestone(this.form.getRawValue().id).subscribe(() => {
510
- this.router.navigate(['/milestones']);
511
- this.alertService.success('Milestone has been deleted');
512
- }, err => {
513
- this.router.navigate(['/milestones']);
514
- this.alertService.error('Could not delete Milestone');
515
- });
516
- }
517
- updateMilestone() {
518
- const milestone = this.form.getRawValue();
519
- milestone.processDefinitionKey = milestone.processDefinitionKey['key'];
520
- this.milestoneService.updateMilestone(milestone).subscribe(() => {
521
- this.router.navigate(['/milestones']);
522
- this.alertService.success('Milestone has been updated');
523
- }, err => {
524
- this.alertService.error('Error updating milestone');
525
- });
526
- }
527
- }
528
- MilestoneEditComponent.decorators = [
529
- { type: Component, args: [{
530
- selector: 'valtimo-milestone-edit',
531
- template: "<!--\n ~ Copyright 2015-2020 Ritense BV, the Netherlands.\n ~\n ~ Licensed under EUPL, Version 1.2 (the \"License\");\n ~ you may not use this file except in compliance with the License.\n ~ You may obtain a copy of the License at\n ~\n ~ https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12\n ~\n ~ Unless required by applicable law or agreed to in writing, software\n ~ distributed under the License is distributed on an \"AS IS\" basis,\n ~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n ~ See the License for the specific language governing permissions and\n ~ limitations under the License.\n -->\n\n<div class=\"main-content\">\n <div class=\"container-fluid\">\n <div class=\"col-12 px-0 mb-5\">\n <valtimo-widget>\n <div 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",
532
- styles: ["/*!\n * Copyright 2015-2020 Ritense BV, the Netherlands.\n *\n * Licensed under EUPL, Version 1.2 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" basis,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */"]
533
- },] }
534
- ];
535
- MilestoneEditComponent.ctorParameters = () => [
536
- { type: MilestoneService },
537
- { type: FormBuilder },
538
- { type: Router },
539
- { type: AlertService },
540
- { type: ProcessService },
541
- { type: ActivatedRoute }
542
- ];
543
-
544
- /*
545
- * Copyright 2015-2020 Ritense BV, the Netherlands.
546
- *
547
- * Licensed under EUPL, Version 1.2 (the "License");
548
- * you may not use this file except in compliance with the License.
549
- * You may obtain a copy of the License at
550
- *
551
- * https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12
552
- *
553
- * Unless required by applicable law or agreed to in writing, software
554
- * distributed under the License is distributed on an "AS IS" basis,
555
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
556
- * See the License for the specific language governing permissions and
557
- * limitations under the License.
558
- */
559
- const ɵ0 = { title: 'Milestones', roles: [ROLE_ADMIN] }, ɵ1 = { title: 'Create new Milestone Set', roles: [ROLE_ADMIN] }, ɵ2 = { title: 'Create new Milestone', roles: [ROLE_ADMIN] }, ɵ3 = { title: 'Milestone Set details', roles: [ROLE_ADMIN] }, ɵ4 = { title: 'Milestone details', roles: [ROLE_ADMIN] };
560
- const routes = [
561
- {
562
- path: 'milestones',
563
- component: MilestoneComponent,
564
- canActivate: [AuthGuardService],
565
- data: ɵ0,
566
- },
567
- {
568
- path: 'milestones/sets/create',
569
- component: MilestoneSetCreateComponent,
570
- canActivate: [AuthGuardService],
571
- data: ɵ1,
572
- },
573
- {
574
- path: 'milestones/create',
575
- component: MilestoneCreateComponent,
576
- canActivate: [AuthGuardService],
577
- data: ɵ2,
578
- },
579
- {
580
- path: 'milestones/sets/set/:id',
581
- component: MilestoneSetEditComponent,
582
- canActivate: [AuthGuardService],
583
- data: ɵ3,
584
- },
585
- {
586
- path: 'milestones/milestone/:id',
587
- component: MilestoneEditComponent,
588
- canActivate: [AuthGuardService],
589
- data: ɵ4,
590
- },
591
- ];
592
- class MilestoneRoutingModule {
593
- }
594
- MilestoneRoutingModule.decorators = [
595
- { type: NgModule, args: [{
596
- declarations: [],
597
- imports: [CommonModule, RouterModule.forChild(routes)],
598
- exports: [RouterModule],
599
- },] }
600
- ];
601
-
602
- /*
603
- * Copyright 2015-2020 Ritense BV, the Netherlands.
604
- *
605
- * Licensed under EUPL, Version 1.2 (the "License");
606
- * you may not use this file except in compliance with the License.
607
- * You may obtain a copy of the License at
608
- *
609
- * https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12
610
- *
611
- * Unless required by applicable law or agreed to in writing, software
612
- * distributed under the License is distributed on an "AS IS" basis,
613
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
614
- * See the License for the specific language governing permissions and
615
- * limitations under the License.
616
- */
617
- class MilestoneListComponent {
618
- constructor(milestoneService, router) {
619
- this.milestoneService = milestoneService;
620
- this.router = router;
621
- this.milestones = [];
622
- this.milestoneFields = [
623
- { key: 'id', label: 'ID' },
624
- { key: 'title', label: 'Title' },
625
- { key: 'processDefinitionKey', label: 'Process' },
626
- { key: 'taskDefinitionKey', label: 'Task' },
627
- { key: 'plannedIntervalInDays', label: 'Interval (in days)' },
628
- { key: 'color', label: 'Color' },
629
- ];
630
- }
631
- editMilestoneSet(milestoneSetId) {
632
- this.router.navigate(['milestones/sets/set', milestoneSetId]);
633
- }
634
- editMilestone(milestone) {
635
- this.router.navigate(['milestones/milestone', milestone.id]);
636
- }
637
- ngOnInit() {
638
- combineLatest([
639
- this.milestoneService.getMilestones(),
640
- this.milestoneService.getMilestoneSets(),
641
- ]).subscribe(([milestones, milestoneSets]) => this.handleMilestoneResult(milestones, milestoneSets));
642
- }
643
- handleMilestoneResult(milestones, milestoneSets) {
644
- const milestoneSetsMap = this.getMilestoneSetsMap(milestones, milestoneSets);
645
- this.setMilestones(milestoneSetsMap);
646
- }
647
- setMilestones(milestoneSetsMap) {
648
- this.milestones = Array.from(milestoneSetsMap.entries()).map(entry => {
649
- entry[0] = JSON.parse(entry[0]);
650
- return entry;
651
- });
652
- }
653
- getMilestoneSetsMap(milestones, milestoneSets) {
654
- const mapWithSets = this.addMilestoneSetsToMap(milestoneSets, this.getEmptyMap());
655
- return this.addMilestonesToMap(milestones, mapWithSets);
656
- }
657
- getEmptyMap() {
658
- return new Map();
659
- }
660
- addMilestoneSetsToMap(milestoneSets, map) {
661
- milestoneSets.forEach(milestoneSet => {
662
- map.set(JSON.stringify(milestoneSet), []);
663
- });
664
- return map;
665
- }
666
- addMilestonesToMap(milestones, map) {
667
- milestones.forEach(milestone => {
668
- const milestoneSetString = JSON.stringify(milestone.milestoneSet);
669
- const arr = map.get(milestoneSetString);
670
- arr.push(milestone);
671
- map.set(milestoneSetString, arr);
672
- });
673
- return map;
674
- }
675
- }
676
- MilestoneListComponent.decorators = [
677
- { type: Component, args: [{
678
- selector: 'valtimo-milestone-list',
679
- template: "<!--\n ~ Copyright 2015-2020 Ritense BV, the Netherlands.\n ~\n ~ Licensed under EUPL, Version 1.2 (the \"License\");\n ~ you may not use this file except in compliance with the License.\n ~ You may obtain a copy of the License at\n ~\n ~ https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12\n ~\n ~ Unless required by applicable law or agreed to in writing, software\n ~ distributed under the License is distributed on an \"AS IS\" basis,\n ~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n ~ See the License for the specific language governing permissions and\n ~ limitations under the License.\n -->\n\n<div *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",
680
- styles: ["/*!\n * Copyright 2015-2020 Ritense BV, the Netherlands.\n *\n * Licensed under EUPL, Version 1.2 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" basis,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */.milestone-title{background-color:#f8f9f9;border-bottom:1px solid #dee2e6;cursor:pointer;margin:0;padding:1em}"]
681
- },] }
682
- ];
683
- MilestoneListComponent.ctorParameters = () => [
684
- { type: MilestoneService },
685
- { type: Router }
686
- ];
687
-
688
- /*
689
- * Copyright 2015-2020 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
- class MilestoneModule {
704
- }
705
- MilestoneModule.decorators = [
706
- { type: NgModule, args: [{
707
- declarations: [
708
- MilestoneComponent,
709
- MilestoneSetCreateComponent,
710
- MilestoneListComponent,
711
- MilestoneCreateComponent,
712
- MilestoneEditComponent,
713
- MilestoneSetEditComponent,
714
- ],
715
- imports: [
716
- RouterModule,
717
- MilestoneRoutingModule,
718
- CommonModule,
719
- ListModule,
720
- WidgetModule,
721
- ReactiveFormsModule,
722
- ColorPickerModule,
723
- TranslateModule,
724
- ],
725
- exports: [MilestoneComponent],
726
- },] }
727
- ];
728
-
729
- /*
730
- * Copyright 2015-2020 Ritense BV, the Netherlands.
731
- *
732
- * Licensed under EUPL, Version 1.2 (the "License");
733
- * you may not use this file except in compliance with the License.
734
- * You may obtain a copy of the License at
735
- *
736
- * https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12
737
- *
738
- * Unless required by applicable law or agreed to in writing, software
739
- * distributed under the License is distributed on an "AS IS" basis,
740
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
741
- * See the License for the specific language governing permissions and
742
- * limitations under the License.
743
- */
744
-
745
- /**
746
- * Generated bundle index. Do not edit.
747
- */
748
-
749
- export { MilestoneComponent, MilestoneModule, MilestoneService, MilestoneSetCreateComponent as ɵa, MilestoneListComponent as ɵb, MilestoneCreateComponent as ɵc, MilestoneEditComponent as ɵd, MilestoneSetEditComponent as ɵe, MilestoneRoutingModule as ɵf };
750
- //# sourceMappingURL=valtimo-milestone.js.map