@valtimo/milestone 4.15.2 → 4.16.0-next-main.19
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.
- package/README.md +13 -6
- package/bundles/valtimo-milestone.umd.js +146 -56
- package/bundles/valtimo-milestone.umd.js.map +1 -1
- package/bundles/valtimo-milestone.umd.min.js +1 -1
- package/bundles/valtimo-milestone.umd.min.js.map +1 -1
- package/esm2015/lib/milestone-create/milestone-create.component.js +15 -7
- package/esm2015/lib/milestone-edit/milestone-edit.component.js +19 -10
- package/esm2015/lib/milestone-list/milestone-list.component.js +8 -6
- package/esm2015/lib/milestone-routing.module.js +9 -12
- package/esm2015/lib/milestone-set-create/milestone-set-create.component.js +4 -4
- package/esm2015/lib/milestone-set-edit/milestone-set-edit.component.js +8 -6
- package/esm2015/lib/milestone.component.js +3 -5
- package/esm2015/lib/milestone.module.js +11 -5
- package/esm2015/lib/milestone.service.js +2 -2
- package/esm2015/lib/models/index.js +20 -0
- package/esm2015/lib/models/milestone-set.model.js +16 -0
- package/esm2015/lib/models/milestone.model.js +16 -0
- package/esm2015/public-api.js +2 -1
- package/esm2015/valtimo-milestone.js +1 -1
- package/fesm2015/valtimo-milestone.js +120 -49
- package/fesm2015/valtimo-milestone.js.map +1 -1
- package/lib/milestone-create/milestone-create.component.d.ts +2 -2
- package/lib/milestone-edit/milestone-edit.component.d.ts +2 -2
- package/lib/milestone-list/milestone-list.component.d.ts +1 -1
- package/lib/milestone.service.d.ts +1 -1
- package/lib/models/index.d.ts +2 -0
- package/lib/models/milestone-set.model.d.ts +4 -0
- package/lib/models/milestone.model.d.ts +10 -0
- package/package.json +1 -1
- package/public-api.d.ts +1 -0
- package/valtimo-milestone.metadata.json +1 -1
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { ɵɵdefineInjectable, ɵɵinject, Injectable, Component, NgModule } from '@angular/core';
|
|
2
2
|
import { HttpClient } from '@angular/common/http';
|
|
3
|
-
import { ConfigService } from '@valtimo/config';
|
|
3
|
+
import { ConfigService, ROLE_ADMIN } from '@valtimo/config';
|
|
4
4
|
import { FormControl, Validators, FormBuilder, ReactiveFormsModule } from '@angular/forms';
|
|
5
5
|
import { AlertService, ListModule, WidgetModule } from '@valtimo/components';
|
|
6
6
|
import { Router, ActivatedRoute, RouterModule } from '@angular/router';
|
|
@@ -8,11 +8,60 @@ import { CommonModule } from '@angular/common';
|
|
|
8
8
|
import { AuthGuardService } from '@valtimo/security';
|
|
9
9
|
import { ProcessService } from '@valtimo/process';
|
|
10
10
|
import { switchMap } from 'rxjs/operators';
|
|
11
|
-
import { ROLE_ADMIN } from '@valtimo/contract';
|
|
12
11
|
import { combineLatest } from 'rxjs';
|
|
13
12
|
import { ColorPickerModule } from 'ngx-color-picker';
|
|
14
13
|
import { TranslateModule } from '@ngx-translate/core';
|
|
15
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
|
+
|
|
16
65
|
/*
|
|
17
66
|
* Copyright 2015-2020 Ritense BV, the Netherlands.
|
|
18
67
|
*
|
|
@@ -71,7 +120,7 @@ class MilestoneService {
|
|
|
71
120
|
MilestoneService.ɵprov = ɵɵdefineInjectable({ factory: function MilestoneService_Factory() { return new MilestoneService(ɵɵinject(ConfigService), ɵɵinject(HttpClient)); }, token: MilestoneService, providedIn: "root" });
|
|
72
121
|
MilestoneService.decorators = [
|
|
73
122
|
{ type: Injectable, args: [{
|
|
74
|
-
providedIn: 'root'
|
|
123
|
+
providedIn: 'root',
|
|
75
124
|
},] }
|
|
76
125
|
];
|
|
77
126
|
MilestoneService.ctorParameters = () => [
|
|
@@ -95,10 +144,8 @@ MilestoneService.ctorParameters = () => [
|
|
|
95
144
|
* limitations under the License.
|
|
96
145
|
*/
|
|
97
146
|
class MilestoneComponent {
|
|
98
|
-
constructor() {
|
|
99
|
-
}
|
|
100
|
-
ngOnInit() {
|
|
101
|
-
}
|
|
147
|
+
constructor() { }
|
|
148
|
+
ngOnInit() { }
|
|
102
149
|
}
|
|
103
150
|
MilestoneComponent.decorators = [
|
|
104
151
|
{ type: Component, args: [{
|
|
@@ -136,12 +183,12 @@ class MilestoneSetCreateComponent {
|
|
|
136
183
|
}
|
|
137
184
|
ngOnInit() {
|
|
138
185
|
this.form = this.formBuilder.group({
|
|
139
|
-
title: new FormControl('', Validators.required)
|
|
186
|
+
title: new FormControl('', Validators.required),
|
|
140
187
|
});
|
|
141
188
|
}
|
|
142
189
|
reset() {
|
|
143
190
|
this.form.setValue({
|
|
144
|
-
title: ''
|
|
191
|
+
title: '',
|
|
145
192
|
});
|
|
146
193
|
}
|
|
147
194
|
createMilestoneSet() {
|
|
@@ -154,7 +201,7 @@ class MilestoneSetCreateComponent {
|
|
|
154
201
|
MilestoneSetCreateComponent.decorators = [
|
|
155
202
|
{ type: Component, args: [{
|
|
156
203
|
selector: 'valtimo-milestone-set-create',
|
|
157
|
-
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
|
|
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",
|
|
158
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 */"]
|
|
159
206
|
},] }
|
|
160
207
|
];
|
|
@@ -200,8 +247,14 @@ class MilestoneCreateComponent {
|
|
|
200
247
|
title: new FormControl('', Validators.required),
|
|
201
248
|
processDefinitionKey: new FormControl('', Validators.required),
|
|
202
249
|
taskDefinitionKey: new FormControl('', Validators.required),
|
|
203
|
-
plannedIntervalInDays: new FormControl('', [
|
|
204
|
-
|
|
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
|
+
]),
|
|
205
258
|
});
|
|
206
259
|
this.getMilestoneSets();
|
|
207
260
|
this.getMilestones();
|
|
@@ -213,7 +266,7 @@ class MilestoneCreateComponent {
|
|
|
213
266
|
processDefinitionKey: '',
|
|
214
267
|
taskDefinitionKey: '',
|
|
215
268
|
plannedIntervalInDays: '',
|
|
216
|
-
color: ''
|
|
269
|
+
color: '',
|
|
217
270
|
});
|
|
218
271
|
}
|
|
219
272
|
getMilestoneSets() {
|
|
@@ -222,7 +275,9 @@ class MilestoneCreateComponent {
|
|
|
222
275
|
});
|
|
223
276
|
}
|
|
224
277
|
getMilestones() {
|
|
225
|
-
this.processService
|
|
278
|
+
this.processService
|
|
279
|
+
.getProcessDefinitions()
|
|
280
|
+
.subscribe((processDefinitions) => {
|
|
226
281
|
this.processDefinitions = processDefinitions;
|
|
227
282
|
});
|
|
228
283
|
}
|
|
@@ -241,7 +296,7 @@ class MilestoneCreateComponent {
|
|
|
241
296
|
this.milestoneService.createMilestone(milestone).subscribe(() => {
|
|
242
297
|
this.router.navigate(['/milestones']);
|
|
243
298
|
this.alertService.success('New Milestone has been created');
|
|
244
|
-
},
|
|
299
|
+
}, err => {
|
|
245
300
|
this.alertService.error('Error creating new milestone');
|
|
246
301
|
});
|
|
247
302
|
}
|
|
@@ -249,7 +304,7 @@ class MilestoneCreateComponent {
|
|
|
249
304
|
MilestoneCreateComponent.decorators = [
|
|
250
305
|
{ type: Component, args: [{
|
|
251
306
|
selector: 'valtimo-milestone-create',
|
|
252
|
-
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\">Milestone set</label>\n <div class=\"col-12 col-sm-8 col-lg-6\">\n <select type=\"text\" id=\"milestoneSet\" formControlName=\"milestoneSet\"\n class=\"form-control\"\n [ngClass]=\"{'is-valid': formControls.milestoneSet.touched && formControls.milestoneSet.valid, 'is-invalid': formControls.milestoneSet.touched && formControls.milestoneSet.errors}\"\n required>\n <option value=\"\" selected disabled>Choose a Milestone set</option>\n <option *ngFor=\"let milestoneSet of milestoneSets\" [value]=\"milestoneSet.id\">{{milestoneSet.title}} ({{milestoneSet.id}})</option>\n </select>\n <div *ngIf=\"formControls.milestoneSet.touched && formControls.milestoneSet.errors\"\n class=\"invalid-feedback\">\n <div *ngIf=\"formControls.milestoneSet.errors.required\">Milestone set is required</div>\n </div>\n </div>\n </div>\n\n <div class=\"form-group row\">\n <label class=\"col-12 col-sm-3 col-form-label text-sm-right\" for=\"title\">Title</label>\n <div class=\"col-12 col-sm-8 col-lg-6\">\n <input type=\"text\" id=\"title\" formControlName=\"title\"\n class=\"form-control\" placeholder=\"Milestone title\"\n [ngClass]=\"{'is-valid': formControls.title.touched && formControls.title.valid, 'is-invalid': formControls.title.touched && formControls.title.errors}\"\n required/>\n <div *ngIf=\"formControls.title.touched && formControls.title.errors\"\n class=\"invalid-feedback\">\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\">Process definition</label>\n <div class=\"col-12 col-sm-8 col-lg-6\">\n <select type=\"text\" id=\"process\" formControlName=\"processDefinitionKey\"\n class=\"form-control\" (ngModelChange)=\"getFlownodes($event.id)\"\n [ngClass]=\"{'is-valid': formControls.processDefinitionKey.touched && formControls.processDefinitionKey.valid, 'is-invalid': formControls.processDefinitionKey.touched && formControls.processDefinitionKey.errors}\"\n required>\n <option value=\"\" selected disabled>Choose a process</option>\n <option *ngFor=\"let processDefinition of processDefinitions\" [ngValue]=\"processDefinition\">{{processDefinition.name}} ({{processDefinition.key}})</option>\n </select>\n <div *ngIf=\"formControls.processDefinitionKey.touched && formControls.processDefinitionKey.errors\"\n class=\"invalid-feedback\">\n <div *ngIf=\"formControls.processDefinitionKey.errors.required\">Process 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\">Task</label>\n <div class=\"col-12 col-sm-8 col-lg-6\">\n <select type=\"text\" id=\"task\" formControlName=\"taskDefinitionKey\"\n class=\"form-control\"\n [ngClass]=\"{'is-valid': formControls.taskDefinitionKey.touched && formControls.taskDefinitionKey.valid, 'is-invalid': formControls.taskDefinitionKey.touched && formControls.taskDefinitionKey.errors}\"\n required>\n <option value=\"\" selected disabled>Choose a task</option>\n <option *ngFor=\"let taskDefinition of taskDefinitions |keyvalue\" [value]=\"taskDefinition.key\">{{taskDefinition.value}} ({{taskDefinition.key}})</option>\n </select>\n <div *ngIf=\"formControls.taskDefinitionKey.touched && formControls.taskDefinitionKey.errors\"\n class=\"invalid-feedback\">\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\">Interval (in days)</label>\n <div class=\"col-12 col-sm-8 col-lg-6\">\n <input type=\"text\" id=\"interval\" formControlName=\"plannedIntervalInDays\"\n class=\"form-control\" placeholder=\"Interval (in days)\"\n [ngClass]=\"{'is-valid': formControls.plannedIntervalInDays.touched && formControls.plannedIntervalInDays.valid, 'is-invalid': formControls.plannedIntervalInDays.touched && formControls.plannedIntervalInDays.errors}\"\n required/>\n <div *ngIf=\"formControls.plannedIntervalInDays.touched && formControls.plannedIntervalInDays.errors\"\n class=\"invalid-feedback\">\n <div *ngIf=\"formControls.plannedIntervalInDays.errors.required\">Interval is required</div>\n <div *ngIf=\"formControls.plannedIntervalInDays.errors.pattern\">Interval is not a valid number</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\n <input [colorPicker]=\"form.value.color\"\n (colorPickerChange)=\"form.controls.color.setValue($event)\"\n [style.background]=\"form.value.color\"\n type=\"text\" id=\"color\" formControlName=\"color\"\n class=\"form-control\" placeholder=\"Color\"\n [ngClass]=\"{'is-valid': formControls.color.touched && formControls.color.valid, 'is-invalid': formControls.color.touched && formControls.color.errors}\"\n required/>\n <div *ngIf=\"formControls.color.touched && formControls.color.errors\"\n class=\"invalid-feedback\">\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()\">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",
|
|
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",
|
|
253
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 */"]
|
|
254
309
|
},] }
|
|
255
310
|
];
|
|
@@ -290,7 +345,7 @@ class MilestoneSetEditComponent {
|
|
|
290
345
|
ngOnInit() {
|
|
291
346
|
this.form = this.formBuilder.group({
|
|
292
347
|
id: new FormControl({ value: '', disabled: true }, Validators.required),
|
|
293
|
-
title: new FormControl({}, Validators.required)
|
|
348
|
+
title: new FormControl({}, Validators.required),
|
|
294
349
|
});
|
|
295
350
|
this.getMilestoneSet();
|
|
296
351
|
}
|
|
@@ -299,10 +354,12 @@ class MilestoneSetEditComponent {
|
|
|
299
354
|
}
|
|
300
355
|
getMilestoneSet() {
|
|
301
356
|
const milestoneSetId = this.route.snapshot.paramMap.get('id');
|
|
302
|
-
this.milestoneService
|
|
357
|
+
this.milestoneService
|
|
358
|
+
.getMilestoneSet(+milestoneSetId)
|
|
359
|
+
.subscribe((milestoneSet) => {
|
|
303
360
|
this.form.setValue({
|
|
304
361
|
id: milestoneSet.id,
|
|
305
|
-
title: milestoneSet.title
|
|
362
|
+
title: milestoneSet.title,
|
|
306
363
|
});
|
|
307
364
|
});
|
|
308
365
|
}
|
|
@@ -314,7 +371,7 @@ class MilestoneSetEditComponent {
|
|
|
314
371
|
this.milestoneService.deleteMilestoneSet(this.form.getRawValue().id).subscribe(() => {
|
|
315
372
|
this.router.navigate(['/milestones']);
|
|
316
373
|
this.alertService.success('Milestone set has been deleted');
|
|
317
|
-
},
|
|
374
|
+
}, err => {
|
|
318
375
|
this.router.navigate(['/milestones']);
|
|
319
376
|
this.alertService.error('Could not delete Milestone set. Make sure this Milestone set does not contain any milestones.');
|
|
320
377
|
});
|
|
@@ -329,7 +386,7 @@ class MilestoneSetEditComponent {
|
|
|
329
386
|
MilestoneSetEditComponent.decorators = [
|
|
330
387
|
{ type: Component, args: [{
|
|
331
388
|
selector: 'valtimo-milestone-set-edit',
|
|
332
|
-
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
|
|
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",
|
|
333
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 */"]
|
|
334
391
|
},] }
|
|
335
392
|
];
|
|
@@ -378,8 +435,14 @@ class MilestoneEditComponent {
|
|
|
378
435
|
title: new FormControl('', Validators.required),
|
|
379
436
|
processDefinitionKey: new FormControl('', Validators.required),
|
|
380
437
|
taskDefinitionKey: new FormControl('', Validators.required),
|
|
381
|
-
plannedIntervalInDays: new FormControl('', [
|
|
382
|
-
|
|
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
|
+
]),
|
|
383
446
|
});
|
|
384
447
|
this.getMilestone();
|
|
385
448
|
this.getMilestoneSets();
|
|
@@ -392,12 +455,13 @@ class MilestoneEditComponent {
|
|
|
392
455
|
processDefinitionKey: '',
|
|
393
456
|
taskDefinitionKey: '',
|
|
394
457
|
plannedIntervalInDays: '',
|
|
395
|
-
color: ''
|
|
458
|
+
color: '',
|
|
396
459
|
});
|
|
397
460
|
}
|
|
398
461
|
getMilestone() {
|
|
399
462
|
const milestoneId = this.route.snapshot.paramMap.get('id');
|
|
400
|
-
this.milestoneService
|
|
463
|
+
this.milestoneService
|
|
464
|
+
.getMilestone(+milestoneId)
|
|
401
465
|
.pipe(switchMap((milestone) => {
|
|
402
466
|
this.form.patchValue({
|
|
403
467
|
id: milestone.id,
|
|
@@ -411,7 +475,7 @@ class MilestoneEditComponent {
|
|
|
411
475
|
}))
|
|
412
476
|
.subscribe((processDefinition) => {
|
|
413
477
|
this.form.patchValue({
|
|
414
|
-
processDefinitionKey: processDefinition
|
|
478
|
+
processDefinitionKey: processDefinition,
|
|
415
479
|
});
|
|
416
480
|
});
|
|
417
481
|
}
|
|
@@ -424,7 +488,9 @@ class MilestoneEditComponent {
|
|
|
424
488
|
});
|
|
425
489
|
}
|
|
426
490
|
getProcessDefinitions() {
|
|
427
|
-
this.processService
|
|
491
|
+
this.processService
|
|
492
|
+
.getProcessDefinitions()
|
|
493
|
+
.subscribe((processDefinitions) => {
|
|
428
494
|
this.processDefinitions = processDefinitions;
|
|
429
495
|
});
|
|
430
496
|
}
|
|
@@ -443,7 +509,7 @@ class MilestoneEditComponent {
|
|
|
443
509
|
this.milestoneService.deleteMilestone(this.form.getRawValue().id).subscribe(() => {
|
|
444
510
|
this.router.navigate(['/milestones']);
|
|
445
511
|
this.alertService.success('Milestone has been deleted');
|
|
446
|
-
},
|
|
512
|
+
}, err => {
|
|
447
513
|
this.router.navigate(['/milestones']);
|
|
448
514
|
this.alertService.error('Could not delete Milestone');
|
|
449
515
|
});
|
|
@@ -454,7 +520,7 @@ class MilestoneEditComponent {
|
|
|
454
520
|
this.milestoneService.updateMilestone(milestone).subscribe(() => {
|
|
455
521
|
this.router.navigate(['/milestones']);
|
|
456
522
|
this.alertService.success('Milestone has been updated');
|
|
457
|
-
},
|
|
523
|
+
}, err => {
|
|
458
524
|
this.alertService.error('Error updating milestone');
|
|
459
525
|
});
|
|
460
526
|
}
|
|
@@ -462,7 +528,7 @@ class MilestoneEditComponent {
|
|
|
462
528
|
MilestoneEditComponent.decorators = [
|
|
463
529
|
{ type: Component, args: [{
|
|
464
530
|
selector: 'valtimo-milestone-edit',
|
|
465
|
-
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\">Milestone set</label>\n <div class=\"col-12 col-sm-8 col-lg-6\">\n <select type=\"text\" id=\"milestoneSet\" formControlName=\"milestoneSet\"\n class=\"form-control\"\n [ngClass]=\"{'is-valid': formControls.milestoneSet.touched && formControls.milestoneSet.valid, 'is-invalid': formControls.milestoneSet.touched && formControls.milestoneSet.errors}\"\n required>\n <option value=\"\" selected disabled>Choose a Milestone set</option>\n <option *ngFor=\"let milestoneSet of milestoneSets\" [value]=\"milestoneSet.id\">{{milestoneSet.title}} ({{milestoneSet.id}})</option>\n </select>\n <div *ngIf=\"formControls.milestoneSet.touched && formControls.milestoneSet.errors\"\n class=\"invalid-feedback\">\n <div *ngIf=\"formControls.milestoneSet.errors.required\">Milestone set is required</div>\n </div>\n </div>\n </div>\n\n <div class=\"form-group row\">\n <label class=\"col-12 col-sm-3 col-form-label text-sm-right\" for=\"title\">Title</label>\n <div class=\"col-12 col-sm-8 col-lg-6\">\n <input type=\"text\" id=\"title\" formControlName=\"title\"\n class=\"form-control\" placeholder=\"Milestone title\"\n [ngClass]=\"{'is-valid': formControls.title.touched && formControls.title.valid, 'is-invalid': formControls.title.touched && formControls.title.errors}\"\n required/>\n <div *ngIf=\"formControls.title.touched && formControls.title.errors\"\n class=\"invalid-feedback\">\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\">Process definition</label>\n <div class=\"col-12 col-sm-8 col-lg-6\">\n <select type=\"text\" id=\"process\" formControlName=\"processDefinitionKey\"\n class=\"form-control\" (ngModelChange)=\"getFlownodes($event.id)\"\n [ngClass]=\"{'is-valid': formControls.processDefinitionKey.touched && formControls.processDefinitionKey.valid, 'is-invalid': formControls.processDefinitionKey.touched && formControls.processDefinitionKey.errors}\"\n required [compareWith]=\"compareProcessDefinitions\">\n <option value=\"\" disabled>Choose a process</option>\n <option *ngFor=\"let processDefinition of processDefinitions\" [ngValue]=\"processDefinition\">{{processDefinition.name}} ({{processDefinition.key}})</option>\n </select>\n <div *ngIf=\"formControls.processDefinitionKey.touched && formControls.processDefinitionKey.errors\"\n class=\"invalid-feedback\">\n <div *ngIf=\"formControls.processDefinitionKey.errors.required\">Process 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\">Task</label>\n <div class=\"col-12 col-sm-8 col-lg-6\">\n <select type=\"text\" id=\"task\" formControlName=\"taskDefinitionKey\"\n class=\"form-control\"\n [ngClass]=\"{'is-valid': formControls.taskDefinitionKey.touched && formControls.taskDefinitionKey.valid, 'is-invalid': formControls.taskDefinitionKey.touched && formControls.taskDefinitionKey.errors}\"\n required>\n <option value=\"\" disabled>Choose a task</option>\n <option *ngFor=\"let taskDefinition of taskDefinitions |keyvalue\" [value]=\"taskDefinition.key\">{{taskDefinition.value}} ({{taskDefinition.key}})</option>\n </select>\n <div *ngIf=\"formControls.taskDefinitionKey.touched && formControls.taskDefinitionKey.errors\"\n class=\"invalid-feedback\">\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\">Interval (in days)</label>\n <div class=\"col-12 col-sm-8 col-lg-6\">\n <input type=\"text\" id=\"interval\" formControlName=\"plannedIntervalInDays\"\n class=\"form-control\" placeholder=\"Interval (in days)\"\n [ngClass]=\"{'is-valid': formControls.plannedIntervalInDays.touched && formControls.plannedIntervalInDays.valid, 'is-invalid': formControls.plannedIntervalInDays.touched && formControls.plannedIntervalInDays.errors}\"\n required/>\n <div *ngIf=\"formControls.plannedIntervalInDays.touched && formControls.plannedIntervalInDays.errors\"\n class=\"invalid-feedback\">\n <div *ngIf=\"formControls.plannedIntervalInDays.errors.required\">Interval is required</div>\n <div *ngIf=\"formControls.plannedIntervalInDays.errors.pattern\">Interval is not a valid number</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\n <input [colorPicker]=\"form.value.color\"\n (colorPickerChange)=\"form.controls.color.setValue($event)\"\n [style.background]=\"form.value.color\"\n type=\"text\" id=\"color\" formControlName=\"color\"\n class=\"form-control\" placeholder=\"Color\"\n [ngClass]=\"{'is-valid': formControls.color.touched && formControls.color.valid, 'is-invalid': formControls.color.touched && formControls.color.errors}\"\n required/>\n <div *ngIf=\"formControls.color.touched && formControls.color.errors\"\n class=\"invalid-feedback\">\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()\">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",
|
|
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",
|
|
466
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 */"]
|
|
467
533
|
},] }
|
|
468
534
|
];
|
|
@@ -496,31 +562,31 @@ const routes = [
|
|
|
496
562
|
path: 'milestones',
|
|
497
563
|
component: MilestoneComponent,
|
|
498
564
|
canActivate: [AuthGuardService],
|
|
499
|
-
data: ɵ0
|
|
565
|
+
data: ɵ0,
|
|
500
566
|
},
|
|
501
567
|
{
|
|
502
568
|
path: 'milestones/sets/create',
|
|
503
569
|
component: MilestoneSetCreateComponent,
|
|
504
570
|
canActivate: [AuthGuardService],
|
|
505
|
-
data: ɵ1
|
|
571
|
+
data: ɵ1,
|
|
506
572
|
},
|
|
507
573
|
{
|
|
508
574
|
path: 'milestones/create',
|
|
509
575
|
component: MilestoneCreateComponent,
|
|
510
576
|
canActivate: [AuthGuardService],
|
|
511
|
-
data: ɵ2
|
|
577
|
+
data: ɵ2,
|
|
512
578
|
},
|
|
513
579
|
{
|
|
514
580
|
path: 'milestones/sets/set/:id',
|
|
515
581
|
component: MilestoneSetEditComponent,
|
|
516
582
|
canActivate: [AuthGuardService],
|
|
517
|
-
data: ɵ3
|
|
583
|
+
data: ɵ3,
|
|
518
584
|
},
|
|
519
585
|
{
|
|
520
586
|
path: 'milestones/milestone/:id',
|
|
521
587
|
component: MilestoneEditComponent,
|
|
522
588
|
canActivate: [AuthGuardService],
|
|
523
|
-
data: ɵ4
|
|
589
|
+
data: ɵ4,
|
|
524
590
|
},
|
|
525
591
|
];
|
|
526
592
|
class MilestoneRoutingModule {
|
|
@@ -528,11 +594,8 @@ class MilestoneRoutingModule {
|
|
|
528
594
|
MilestoneRoutingModule.decorators = [
|
|
529
595
|
{ type: NgModule, args: [{
|
|
530
596
|
declarations: [],
|
|
531
|
-
imports: [
|
|
532
|
-
|
|
533
|
-
RouterModule.forChild(routes),
|
|
534
|
-
],
|
|
535
|
-
exports: [RouterModule]
|
|
597
|
+
imports: [CommonModule, RouterModule.forChild(routes)],
|
|
598
|
+
exports: [RouterModule],
|
|
536
599
|
},] }
|
|
537
600
|
];
|
|
538
601
|
|
|
@@ -572,8 +635,10 @@ class MilestoneListComponent {
|
|
|
572
635
|
this.router.navigate(['milestones/milestone', milestone.id]);
|
|
573
636
|
}
|
|
574
637
|
ngOnInit() {
|
|
575
|
-
combineLatest([
|
|
576
|
-
.
|
|
638
|
+
combineLatest([
|
|
639
|
+
this.milestoneService.getMilestones(),
|
|
640
|
+
this.milestoneService.getMilestoneSets(),
|
|
641
|
+
]).subscribe(([milestones, milestoneSets]) => this.handleMilestoneResult(milestones, milestoneSets));
|
|
577
642
|
}
|
|
578
643
|
handleMilestoneResult(milestones, milestoneSets) {
|
|
579
644
|
const milestoneSetsMap = this.getMilestoneSetsMap(milestones, milestoneSets);
|
|
@@ -593,13 +658,13 @@ class MilestoneListComponent {
|
|
|
593
658
|
return new Map();
|
|
594
659
|
}
|
|
595
660
|
addMilestoneSetsToMap(milestoneSets, map) {
|
|
596
|
-
milestoneSets.forEach(
|
|
661
|
+
milestoneSets.forEach(milestoneSet => {
|
|
597
662
|
map.set(JSON.stringify(milestoneSet), []);
|
|
598
663
|
});
|
|
599
664
|
return map;
|
|
600
665
|
}
|
|
601
666
|
addMilestonesToMap(milestones, map) {
|
|
602
|
-
milestones.forEach(
|
|
667
|
+
milestones.forEach(milestone => {
|
|
603
668
|
const milestoneSetString = JSON.stringify(milestone.milestoneSet);
|
|
604
669
|
const arr = map.get(milestoneSetString);
|
|
605
670
|
arr.push(milestone);
|
|
@@ -611,7 +676,7 @@ class MilestoneListComponent {
|
|
|
611
676
|
MilestoneListComponent.decorators = [
|
|
612
677
|
{ type: Component, args: [{
|
|
613
678
|
selector: 'valtimo-milestone-list',
|
|
614
|
-
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\"
|
|
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",
|
|
615
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}"]
|
|
616
681
|
},] }
|
|
617
682
|
];
|
|
@@ -639,8 +704,14 @@ class MilestoneModule {
|
|
|
639
704
|
}
|
|
640
705
|
MilestoneModule.decorators = [
|
|
641
706
|
{ type: NgModule, args: [{
|
|
642
|
-
declarations: [
|
|
643
|
-
|
|
707
|
+
declarations: [
|
|
708
|
+
MilestoneComponent,
|
|
709
|
+
MilestoneSetCreateComponent,
|
|
710
|
+
MilestoneListComponent,
|
|
711
|
+
MilestoneCreateComponent,
|
|
712
|
+
MilestoneEditComponent,
|
|
713
|
+
MilestoneSetEditComponent,
|
|
714
|
+
],
|
|
644
715
|
imports: [
|
|
645
716
|
RouterModule,
|
|
646
717
|
MilestoneRoutingModule,
|
|
@@ -649,9 +720,9 @@ MilestoneModule.decorators = [
|
|
|
649
720
|
WidgetModule,
|
|
650
721
|
ReactiveFormsModule,
|
|
651
722
|
ColorPickerModule,
|
|
652
|
-
TranslateModule
|
|
723
|
+
TranslateModule,
|
|
653
724
|
],
|
|
654
|
-
exports: [MilestoneComponent]
|
|
725
|
+
exports: [MilestoneComponent],
|
|
655
726
|
},] }
|
|
656
727
|
];
|
|
657
728
|
|