@valtimo/milestone 4.15.3-next-main.15 → 4.15.3-next-main.16
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +13 -6
- package/bundles/valtimo-milestone.umd.js +91 -51
- 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 +8 -11
- 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/public-api.js +1 -1
- package/esm2015/valtimo-milestone.js +1 -1
- package/fesm2015/valtimo-milestone.js +69 -47
- package/fesm2015/valtimo-milestone.js.map +1 -1
- package/package.json +1 -1
- package/valtimo-milestone.metadata.json +1 -1
|
@@ -71,7 +71,7 @@ class MilestoneService {
|
|
|
71
71
|
MilestoneService.ɵprov = ɵɵdefineInjectable({ factory: function MilestoneService_Factory() { return new MilestoneService(ɵɵinject(ConfigService), ɵɵinject(HttpClient)); }, token: MilestoneService, providedIn: "root" });
|
|
72
72
|
MilestoneService.decorators = [
|
|
73
73
|
{ type: Injectable, args: [{
|
|
74
|
-
providedIn: 'root'
|
|
74
|
+
providedIn: 'root',
|
|
75
75
|
},] }
|
|
76
76
|
];
|
|
77
77
|
MilestoneService.ctorParameters = () => [
|
|
@@ -95,10 +95,8 @@ MilestoneService.ctorParameters = () => [
|
|
|
95
95
|
* limitations under the License.
|
|
96
96
|
*/
|
|
97
97
|
class MilestoneComponent {
|
|
98
|
-
constructor() {
|
|
99
|
-
}
|
|
100
|
-
ngOnInit() {
|
|
101
|
-
}
|
|
98
|
+
constructor() { }
|
|
99
|
+
ngOnInit() { }
|
|
102
100
|
}
|
|
103
101
|
MilestoneComponent.decorators = [
|
|
104
102
|
{ type: Component, args: [{
|
|
@@ -136,12 +134,12 @@ class MilestoneSetCreateComponent {
|
|
|
136
134
|
}
|
|
137
135
|
ngOnInit() {
|
|
138
136
|
this.form = this.formBuilder.group({
|
|
139
|
-
title: new FormControl('', Validators.required)
|
|
137
|
+
title: new FormControl('', Validators.required),
|
|
140
138
|
});
|
|
141
139
|
}
|
|
142
140
|
reset() {
|
|
143
141
|
this.form.setValue({
|
|
144
|
-
title: ''
|
|
142
|
+
title: '',
|
|
145
143
|
});
|
|
146
144
|
}
|
|
147
145
|
createMilestoneSet() {
|
|
@@ -154,7 +152,7 @@ class MilestoneSetCreateComponent {
|
|
|
154
152
|
MilestoneSetCreateComponent.decorators = [
|
|
155
153
|
{ type: Component, args: [{
|
|
156
154
|
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
|
|
155
|
+
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
156
|
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
157
|
},] }
|
|
160
158
|
];
|
|
@@ -200,8 +198,14 @@ class MilestoneCreateComponent {
|
|
|
200
198
|
title: new FormControl('', Validators.required),
|
|
201
199
|
processDefinitionKey: new FormControl('', Validators.required),
|
|
202
200
|
taskDefinitionKey: new FormControl('', Validators.required),
|
|
203
|
-
plannedIntervalInDays: new FormControl('', [
|
|
204
|
-
|
|
201
|
+
plannedIntervalInDays: new FormControl('', [
|
|
202
|
+
Validators.required,
|
|
203
|
+
Validators.pattern('^[0-9]*$'),
|
|
204
|
+
]),
|
|
205
|
+
color: new FormControl('', [
|
|
206
|
+
Validators.required,
|
|
207
|
+
Validators.pattern('^#([A-Fa-f0-9]{6}|[A-Fa-f0-9]{3})$'),
|
|
208
|
+
]),
|
|
205
209
|
});
|
|
206
210
|
this.getMilestoneSets();
|
|
207
211
|
this.getMilestones();
|
|
@@ -213,7 +217,7 @@ class MilestoneCreateComponent {
|
|
|
213
217
|
processDefinitionKey: '',
|
|
214
218
|
taskDefinitionKey: '',
|
|
215
219
|
plannedIntervalInDays: '',
|
|
216
|
-
color: ''
|
|
220
|
+
color: '',
|
|
217
221
|
});
|
|
218
222
|
}
|
|
219
223
|
getMilestoneSets() {
|
|
@@ -222,7 +226,9 @@ class MilestoneCreateComponent {
|
|
|
222
226
|
});
|
|
223
227
|
}
|
|
224
228
|
getMilestones() {
|
|
225
|
-
this.processService
|
|
229
|
+
this.processService
|
|
230
|
+
.getProcessDefinitions()
|
|
231
|
+
.subscribe((processDefinitions) => {
|
|
226
232
|
this.processDefinitions = processDefinitions;
|
|
227
233
|
});
|
|
228
234
|
}
|
|
@@ -241,7 +247,7 @@ class MilestoneCreateComponent {
|
|
|
241
247
|
this.milestoneService.createMilestone(milestone).subscribe(() => {
|
|
242
248
|
this.router.navigate(['/milestones']);
|
|
243
249
|
this.alertService.success('New Milestone has been created');
|
|
244
|
-
},
|
|
250
|
+
}, err => {
|
|
245
251
|
this.alertService.error('Error creating new milestone');
|
|
246
252
|
});
|
|
247
253
|
}
|
|
@@ -249,7 +255,7 @@ class MilestoneCreateComponent {
|
|
|
249
255
|
MilestoneCreateComponent.decorators = [
|
|
250
256
|
{ type: Component, args: [{
|
|
251
257
|
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",
|
|
258
|
+
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
259
|
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
260
|
},] }
|
|
255
261
|
];
|
|
@@ -290,7 +296,7 @@ class MilestoneSetEditComponent {
|
|
|
290
296
|
ngOnInit() {
|
|
291
297
|
this.form = this.formBuilder.group({
|
|
292
298
|
id: new FormControl({ value: '', disabled: true }, Validators.required),
|
|
293
|
-
title: new FormControl({}, Validators.required)
|
|
299
|
+
title: new FormControl({}, Validators.required),
|
|
294
300
|
});
|
|
295
301
|
this.getMilestoneSet();
|
|
296
302
|
}
|
|
@@ -299,10 +305,12 @@ class MilestoneSetEditComponent {
|
|
|
299
305
|
}
|
|
300
306
|
getMilestoneSet() {
|
|
301
307
|
const milestoneSetId = this.route.snapshot.paramMap.get('id');
|
|
302
|
-
this.milestoneService
|
|
308
|
+
this.milestoneService
|
|
309
|
+
.getMilestoneSet(+milestoneSetId)
|
|
310
|
+
.subscribe((milestoneSet) => {
|
|
303
311
|
this.form.setValue({
|
|
304
312
|
id: milestoneSet.id,
|
|
305
|
-
title: milestoneSet.title
|
|
313
|
+
title: milestoneSet.title,
|
|
306
314
|
});
|
|
307
315
|
});
|
|
308
316
|
}
|
|
@@ -314,7 +322,7 @@ class MilestoneSetEditComponent {
|
|
|
314
322
|
this.milestoneService.deleteMilestoneSet(this.form.getRawValue().id).subscribe(() => {
|
|
315
323
|
this.router.navigate(['/milestones']);
|
|
316
324
|
this.alertService.success('Milestone set has been deleted');
|
|
317
|
-
},
|
|
325
|
+
}, err => {
|
|
318
326
|
this.router.navigate(['/milestones']);
|
|
319
327
|
this.alertService.error('Could not delete Milestone set. Make sure this Milestone set does not contain any milestones.');
|
|
320
328
|
});
|
|
@@ -329,7 +337,7 @@ class MilestoneSetEditComponent {
|
|
|
329
337
|
MilestoneSetEditComponent.decorators = [
|
|
330
338
|
{ type: Component, args: [{
|
|
331
339
|
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
|
|
340
|
+
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
341
|
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
342
|
},] }
|
|
335
343
|
];
|
|
@@ -378,8 +386,14 @@ class MilestoneEditComponent {
|
|
|
378
386
|
title: new FormControl('', Validators.required),
|
|
379
387
|
processDefinitionKey: new FormControl('', Validators.required),
|
|
380
388
|
taskDefinitionKey: new FormControl('', Validators.required),
|
|
381
|
-
plannedIntervalInDays: new FormControl('', [
|
|
382
|
-
|
|
389
|
+
plannedIntervalInDays: new FormControl('', [
|
|
390
|
+
Validators.required,
|
|
391
|
+
Validators.pattern('^[0-9]*$'),
|
|
392
|
+
]),
|
|
393
|
+
color: new FormControl('', [
|
|
394
|
+
Validators.required,
|
|
395
|
+
Validators.pattern('^#([A-Fa-f0-9]{6}|[A-Fa-f0-9]{3})$'),
|
|
396
|
+
]),
|
|
383
397
|
});
|
|
384
398
|
this.getMilestone();
|
|
385
399
|
this.getMilestoneSets();
|
|
@@ -392,12 +406,13 @@ class MilestoneEditComponent {
|
|
|
392
406
|
processDefinitionKey: '',
|
|
393
407
|
taskDefinitionKey: '',
|
|
394
408
|
plannedIntervalInDays: '',
|
|
395
|
-
color: ''
|
|
409
|
+
color: '',
|
|
396
410
|
});
|
|
397
411
|
}
|
|
398
412
|
getMilestone() {
|
|
399
413
|
const milestoneId = this.route.snapshot.paramMap.get('id');
|
|
400
|
-
this.milestoneService
|
|
414
|
+
this.milestoneService
|
|
415
|
+
.getMilestone(+milestoneId)
|
|
401
416
|
.pipe(switchMap((milestone) => {
|
|
402
417
|
this.form.patchValue({
|
|
403
418
|
id: milestone.id,
|
|
@@ -411,7 +426,7 @@ class MilestoneEditComponent {
|
|
|
411
426
|
}))
|
|
412
427
|
.subscribe((processDefinition) => {
|
|
413
428
|
this.form.patchValue({
|
|
414
|
-
processDefinitionKey: processDefinition
|
|
429
|
+
processDefinitionKey: processDefinition,
|
|
415
430
|
});
|
|
416
431
|
});
|
|
417
432
|
}
|
|
@@ -424,7 +439,9 @@ class MilestoneEditComponent {
|
|
|
424
439
|
});
|
|
425
440
|
}
|
|
426
441
|
getProcessDefinitions() {
|
|
427
|
-
this.processService
|
|
442
|
+
this.processService
|
|
443
|
+
.getProcessDefinitions()
|
|
444
|
+
.subscribe((processDefinitions) => {
|
|
428
445
|
this.processDefinitions = processDefinitions;
|
|
429
446
|
});
|
|
430
447
|
}
|
|
@@ -443,7 +460,7 @@ class MilestoneEditComponent {
|
|
|
443
460
|
this.milestoneService.deleteMilestone(this.form.getRawValue().id).subscribe(() => {
|
|
444
461
|
this.router.navigate(['/milestones']);
|
|
445
462
|
this.alertService.success('Milestone has been deleted');
|
|
446
|
-
},
|
|
463
|
+
}, err => {
|
|
447
464
|
this.router.navigate(['/milestones']);
|
|
448
465
|
this.alertService.error('Could not delete Milestone');
|
|
449
466
|
});
|
|
@@ -454,7 +471,7 @@ class MilestoneEditComponent {
|
|
|
454
471
|
this.milestoneService.updateMilestone(milestone).subscribe(() => {
|
|
455
472
|
this.router.navigate(['/milestones']);
|
|
456
473
|
this.alertService.success('Milestone has been updated');
|
|
457
|
-
},
|
|
474
|
+
}, err => {
|
|
458
475
|
this.alertService.error('Error updating milestone');
|
|
459
476
|
});
|
|
460
477
|
}
|
|
@@ -462,7 +479,7 @@ class MilestoneEditComponent {
|
|
|
462
479
|
MilestoneEditComponent.decorators = [
|
|
463
480
|
{ type: Component, args: [{
|
|
464
481
|
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",
|
|
482
|
+
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
483
|
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
484
|
},] }
|
|
468
485
|
];
|
|
@@ -496,31 +513,31 @@ const routes = [
|
|
|
496
513
|
path: 'milestones',
|
|
497
514
|
component: MilestoneComponent,
|
|
498
515
|
canActivate: [AuthGuardService],
|
|
499
|
-
data: ɵ0
|
|
516
|
+
data: ɵ0,
|
|
500
517
|
},
|
|
501
518
|
{
|
|
502
519
|
path: 'milestones/sets/create',
|
|
503
520
|
component: MilestoneSetCreateComponent,
|
|
504
521
|
canActivate: [AuthGuardService],
|
|
505
|
-
data: ɵ1
|
|
522
|
+
data: ɵ1,
|
|
506
523
|
},
|
|
507
524
|
{
|
|
508
525
|
path: 'milestones/create',
|
|
509
526
|
component: MilestoneCreateComponent,
|
|
510
527
|
canActivate: [AuthGuardService],
|
|
511
|
-
data: ɵ2
|
|
528
|
+
data: ɵ2,
|
|
512
529
|
},
|
|
513
530
|
{
|
|
514
531
|
path: 'milestones/sets/set/:id',
|
|
515
532
|
component: MilestoneSetEditComponent,
|
|
516
533
|
canActivate: [AuthGuardService],
|
|
517
|
-
data: ɵ3
|
|
534
|
+
data: ɵ3,
|
|
518
535
|
},
|
|
519
536
|
{
|
|
520
537
|
path: 'milestones/milestone/:id',
|
|
521
538
|
component: MilestoneEditComponent,
|
|
522
539
|
canActivate: [AuthGuardService],
|
|
523
|
-
data: ɵ4
|
|
540
|
+
data: ɵ4,
|
|
524
541
|
},
|
|
525
542
|
];
|
|
526
543
|
class MilestoneRoutingModule {
|
|
@@ -528,11 +545,8 @@ class MilestoneRoutingModule {
|
|
|
528
545
|
MilestoneRoutingModule.decorators = [
|
|
529
546
|
{ type: NgModule, args: [{
|
|
530
547
|
declarations: [],
|
|
531
|
-
imports: [
|
|
532
|
-
|
|
533
|
-
RouterModule.forChild(routes),
|
|
534
|
-
],
|
|
535
|
-
exports: [RouterModule]
|
|
548
|
+
imports: [CommonModule, RouterModule.forChild(routes)],
|
|
549
|
+
exports: [RouterModule],
|
|
536
550
|
},] }
|
|
537
551
|
];
|
|
538
552
|
|
|
@@ -572,8 +586,10 @@ class MilestoneListComponent {
|
|
|
572
586
|
this.router.navigate(['milestones/milestone', milestone.id]);
|
|
573
587
|
}
|
|
574
588
|
ngOnInit() {
|
|
575
|
-
combineLatest([
|
|
576
|
-
.
|
|
589
|
+
combineLatest([
|
|
590
|
+
this.milestoneService.getMilestones(),
|
|
591
|
+
this.milestoneService.getMilestoneSets(),
|
|
592
|
+
]).subscribe(([milestones, milestoneSets]) => this.handleMilestoneResult(milestones, milestoneSets));
|
|
577
593
|
}
|
|
578
594
|
handleMilestoneResult(milestones, milestoneSets) {
|
|
579
595
|
const milestoneSetsMap = this.getMilestoneSetsMap(milestones, milestoneSets);
|
|
@@ -593,13 +609,13 @@ class MilestoneListComponent {
|
|
|
593
609
|
return new Map();
|
|
594
610
|
}
|
|
595
611
|
addMilestoneSetsToMap(milestoneSets, map) {
|
|
596
|
-
milestoneSets.forEach(
|
|
612
|
+
milestoneSets.forEach(milestoneSet => {
|
|
597
613
|
map.set(JSON.stringify(milestoneSet), []);
|
|
598
614
|
});
|
|
599
615
|
return map;
|
|
600
616
|
}
|
|
601
617
|
addMilestonesToMap(milestones, map) {
|
|
602
|
-
milestones.forEach(
|
|
618
|
+
milestones.forEach(milestone => {
|
|
603
619
|
const milestoneSetString = JSON.stringify(milestone.milestoneSet);
|
|
604
620
|
const arr = map.get(milestoneSetString);
|
|
605
621
|
arr.push(milestone);
|
|
@@ -611,7 +627,7 @@ class MilestoneListComponent {
|
|
|
611
627
|
MilestoneListComponent.decorators = [
|
|
612
628
|
{ type: Component, args: [{
|
|
613
629
|
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\"
|
|
630
|
+
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
631
|
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
632
|
},] }
|
|
617
633
|
];
|
|
@@ -639,8 +655,14 @@ class MilestoneModule {
|
|
|
639
655
|
}
|
|
640
656
|
MilestoneModule.decorators = [
|
|
641
657
|
{ type: NgModule, args: [{
|
|
642
|
-
declarations: [
|
|
643
|
-
|
|
658
|
+
declarations: [
|
|
659
|
+
MilestoneComponent,
|
|
660
|
+
MilestoneSetCreateComponent,
|
|
661
|
+
MilestoneListComponent,
|
|
662
|
+
MilestoneCreateComponent,
|
|
663
|
+
MilestoneEditComponent,
|
|
664
|
+
MilestoneSetEditComponent,
|
|
665
|
+
],
|
|
644
666
|
imports: [
|
|
645
667
|
RouterModule,
|
|
646
668
|
MilestoneRoutingModule,
|
|
@@ -649,9 +671,9 @@ MilestoneModule.decorators = [
|
|
|
649
671
|
WidgetModule,
|
|
650
672
|
ReactiveFormsModule,
|
|
651
673
|
ColorPickerModule,
|
|
652
|
-
TranslateModule
|
|
674
|
+
TranslateModule,
|
|
653
675
|
],
|
|
654
|
-
exports: [MilestoneComponent]
|
|
676
|
+
exports: [MilestoneComponent],
|
|
655
677
|
},] }
|
|
656
678
|
];
|
|
657
679
|
|