mirror of
https://github.com/goharbor/harbor.git
synced 2024-12-23 09:08:26 +01:00
Merge pull request #4986 from pengpengshui/leftNav
Filter out existimg members when add a new member #4364
This commit is contained in:
commit
d16cddda04
@ -50,6 +50,7 @@ import { MemberService } from '../member.service';
|
||||
})
|
||||
export class AddMemberComponent implements AfterViewChecked, OnInit, OnDestroy {
|
||||
|
||||
@Input() memberList: Member[] = [];
|
||||
member: Member = new Member();
|
||||
|
||||
addMemberOpened: boolean;
|
||||
@ -85,6 +86,7 @@ export class AddMemberComponent implements AfterViewChecked, OnInit, OnDestroy {
|
||||
private ref: ChangeDetectorRef) { }
|
||||
|
||||
ngOnInit(): void {
|
||||
|
||||
let resolverData = this.route.snapshot.parent.data;
|
||||
let hasProjectAdminRole: boolean;
|
||||
if (resolverData) {
|
||||
@ -120,8 +122,8 @@ export class AddMemberComponent implements AfterViewChecked, OnInit, OnDestroy {
|
||||
// username autocomplete
|
||||
if (this.userLists && this.userLists.length) {
|
||||
this.selectUserName = [];
|
||||
this.userLists.filter(data => {
|
||||
if (data.username.startsWith(cont.value)) {
|
||||
this.userLists.forEach(data => {
|
||||
if (data.username.startsWith(cont.value) && !this.memberList.find(mem => mem.entity_name === data.username)) {
|
||||
if (this.selectUserName.length < 10) {
|
||||
this.selectUserName.push(data.username);
|
||||
}
|
||||
|
@ -45,5 +45,5 @@
|
||||
</clr-dg-footer>
|
||||
</clr-datagrid>
|
||||
</div>
|
||||
<add-member [projectId]="projectId" (added)="addedMember($event)"></add-member>
|
||||
<add-member [projectId]="projectId" [memberList]="members" (added)="addedMember($event)"></add-member>
|
||||
</div>
|
Loading…
Reference in New Issue
Block a user