Skip to content

Commit

Permalink
implement start over UI (#309)
Browse files Browse the repository at this point in the history
  • Loading branch information
simonmartinez authored Feb 9, 2022
1 parent 0f44e94 commit 67975b5
Show file tree
Hide file tree
Showing 3 changed files with 201 additions and 141 deletions.
2 changes: 1 addition & 1 deletion ui/dashboard/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
Expand Up @@ -403,4 +403,31 @@ export class TaskComponent implements OnInit, OnDestroy {
eventUtask(event: any) {
this._notif.create(event.type, '', event.message);
}

restartTask() {
for (const i in this.validateResolveForm.controls) {
if (Object.prototype.hasOwnProperty.call(this.validateResolveForm.controls, i)) {
this.validateResolveForm.controls[i].markAsDirty();
this.validateResolveForm.controls[i].updateValueAndValidity();
}
}
if (this.validateResolveForm.invalid) {
return;
}

this.loaders.restartTask = true;
this.api.resolution.add({
...this.item,
resolver_inputs: InputsFormComponent.getInputs(this.validateResolveForm.value),
start_over: true,
}).toPromise().then((res: any) => {
this.errors.restartTask = null;
this.display.restartTask = false;
this.loadTask(true);
}).catch((err) => {
this.errors.restartTask = err;
}).finally(() => {
this.loaders.restartTask = false;
});
}
}
Loading

0 comments on commit 67975b5

Please sign in to comment.