Fix bug of UI;

1.One of the request is cancelled when trying to do the multiple deletion for tags
2.when using other languages, switch languages, English button has default border
Signed-off-by: Yogi_Wang <yawang@vmware.com>
This commit is contained in:
Yogi_Wang 2019-11-04 14:25:37 +08:00
parent 8cf5dba39a
commit 03e54729c3
2 changed files with 11 additions and 5 deletions

View File

@ -22,7 +22,7 @@ import {
Output,
ViewChild
} from "@angular/core";
import { forkJoin, Observable, Subject, throwError as observableThrowError } from "rxjs";
import { forkJoin, Observable, Subject, throwError as observableThrowError, of } from "rxjs";
import { catchError, debounceTime, distinctUntilChanged, finalize, map } from 'rxjs/operators';
import { TranslateService } from "@ngx-translate/core";
import { Comparator, Label, State, Tag, TagClickEvent, VulnerabilitySummary } from "../service/interface";
@ -629,9 +629,12 @@ export class TagComponent implements OnInit, AfterViewInit {
observableLists.push(this.delOperate(tag));
});
forkJoin(...observableLists).subscribe((item) => {
this.selectedRow = [];
this.retrieve();
forkJoin(...observableLists).subscribe((items) => {
// if delete one success refresh list
if (items.some(item => !item)) {
this.selectedRow = [];
this.retrieve();
}
});
}
}
@ -669,7 +672,7 @@ export class TagComponent implements OnInit, AfterViewInit {
this.translateService.get(message).subscribe(res =>
operateChanges(operMessage, OperationState.failure, res)
);
return observableThrowError(message);
return of(error);
}));
}
}

View File

@ -59,4 +59,7 @@
width: 36px;
height: 36px;
object-fit: fill;
}
.dropdown-item {
outline: none;
}