TSK-1370: A deleted task is immediately removed from the task list
This commit is contained in:
parent
0a5ec9e701
commit
72476bc76d
|
@ -1,4 +1,4 @@
|
|||
import { Component, OnInit, Input, Output, EventEmitter, OnChanges, SimpleChanges } from '@angular/core';
|
||||
import { Component, Input, Output, EventEmitter, OnChanges, SimpleChanges } from '@angular/core';
|
||||
import { Page } from 'app/shared/models/page';
|
||||
|
||||
@Component({
|
||||
|
|
|
@ -110,7 +110,6 @@ export class FormsValidatorService {
|
|||
}
|
||||
|
||||
validateInputOverflow(inputFieldModel: NgModel, maxLength: Number, event?: any): void {
|
||||
console.log(event);
|
||||
if (this.overflowErrorSubscriptionMap.has(inputFieldModel.name)) {
|
||||
this.overflowErrorSubscriptionMap.get(inputFieldModel.name).unsubscribe();
|
||||
}
|
||||
|
|
|
@ -67,6 +67,11 @@ export class TaskMasterComponent implements OnInit, OnDestroy {
|
|||
this.getTasks();
|
||||
});
|
||||
|
||||
this.taskService.taskDeletedStream.pipe(takeUntil(this.destroy$)).subscribe(() => {
|
||||
this.selectedId = '';
|
||||
this.getTasks();
|
||||
});
|
||||
|
||||
this.orientationService
|
||||
.getOrientation()
|
||||
.pipe(takeUntil(this.destroy$))
|
||||
|
@ -148,7 +153,7 @@ export class TaskMasterComponent implements OnInit, OnDestroy {
|
|||
.pipe(takeUntil(this.destroy$))
|
||||
.subscribe((taskResource) => {
|
||||
this.requestInProgress = false;
|
||||
if (taskResource.tasks && taskResource.tasks.length > 1) {
|
||||
if (taskResource.tasks && taskResource.tasks.length > 0) {
|
||||
this.tasks = taskResource.tasks;
|
||||
} else {
|
||||
this.tasks = [];
|
||||
|
|
|
@ -110,7 +110,7 @@ export class TaskdetailsComponent implements OnInit, OnDestroy {
|
|||
deleteTaskConfirmation(): void {
|
||||
this.deleteTaskSubscription = this.taskService.deleteTask(this.task).subscribe(
|
||||
() => {
|
||||
this.taskService.publishUpdatedTask();
|
||||
this.taskService.publishTaskDeletion();
|
||||
this.task = null;
|
||||
this.router.navigate(['taskana/workplace/tasks']);
|
||||
},
|
||||
|
|
|
@ -14,6 +14,8 @@ export class TaskService {
|
|||
taskChangedStream = this.taskChangedSource.asObservable();
|
||||
private taskSelectedSource = new Subject<Task>();
|
||||
taskSelectedStream = this.taskSelectedSource.asObservable();
|
||||
private taskDeletedSource = new Subject<Task>();
|
||||
taskDeletedStream = this.taskDeletedSource.asObservable();
|
||||
|
||||
constructor(private httpClient: HttpClient, private startupService: StartupService) {}
|
||||
|
||||
|
@ -25,6 +27,10 @@ export class TaskService {
|
|||
this.taskChangedSource.next(task);
|
||||
}
|
||||
|
||||
publishTaskDeletion() {
|
||||
this.taskDeletedSource.next();
|
||||
}
|
||||
|
||||
selectTask(task?: Task) {
|
||||
this.taskSelectedSource.next(task);
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue