Skip to content

Commit 67975b5

Browse files
implement start over UI (#309)
1 parent 0f44e94 commit 67975b5

File tree

3 files changed

+201
-141
lines changed

3 files changed

+201
-141
lines changed

ui/dashboard/package-lock.json

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

ui/dashboard/projects/utask-lib/src/lib/@routes/task/task.component.ts

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -403,4 +403,31 @@ export class TaskComponent implements OnInit, OnDestroy {
403403
eventUtask(event: any) {
404404
this._notif.create(event.type, '', event.message);
405405
}
406+
407+
restartTask() {
408+
for (const i in this.validateResolveForm.controls) {
409+
if (Object.prototype.hasOwnProperty.call(this.validateResolveForm.controls, i)) {
410+
this.validateResolveForm.controls[i].markAsDirty();
411+
this.validateResolveForm.controls[i].updateValueAndValidity();
412+
}
413+
}
414+
if (this.validateResolveForm.invalid) {
415+
return;
416+
}
417+
418+
this.loaders.restartTask = true;
419+
this.api.resolution.add({
420+
...this.item,
421+
resolver_inputs: InputsFormComponent.getInputs(this.validateResolveForm.value),
422+
start_over: true,
423+
}).toPromise().then((res: any) => {
424+
this.errors.restartTask = null;
425+
this.display.restartTask = false;
426+
this.loadTask(true);
427+
}).catch((err) => {
428+
this.errors.restartTask = err;
429+
}).finally(() => {
430+
this.loaders.restartTask = false;
431+
});
432+
}
406433
}

0 commit comments

Comments
 (0)