Skip to content

Commit

Permalink
small fix
Browse files Browse the repository at this point in the history
  • Loading branch information
kbeyro committed Jan 24, 2024
1 parent 9cf9865 commit d201055
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ <h3>{{ 'DOMAINS.LIST.GROUP' | translate }}</h3>
<th scope="col">{{'DOMAINS.GROUP.NAME' | translate}}</th>
<th scope="col"></th>
</tr>
<ng-template ngFor let-user [ngForOf]="domainGroup.accessUsers" let-i="index">
<ng-template ngFor let-user [ngForOf]="domainGroup.managers" let-i="index">
<tr class="table-row">
<td>{{user.username}}</td>
<td>{{user.firstname}} {{user.lastname}}</td>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -153,7 +153,7 @@ export class DomainGroupViewComponent extends BaseComponent implements OnInit {
}

public deleteUserAccess(user: User) {
this.domainGroup.accessUsers = this.domainGroup.accessUsers.filter(val => val.id !== user.id);
this.domainGroup.managers = this.domainGroup.managers.filter(val => val.id !== user.id);
}

/**
Expand All @@ -164,9 +164,9 @@ export class DomainGroupViewComponent extends BaseComponent implements OnInit {
if (search === '') {
this.usersFound = [];
} else {
this.userService.getUserBySearch(search, -1 ).subscribe(data => {
this.userService.getUserBySearchGlobal(search ).subscribe(data => {
this.usersFound = [];
const ids = this.domainGroup.accessUsers.flatMap(val => val.id);
const ids = this.domainGroup.managers.flatMap(val => val.id);
const idsLocalAdded = this.usersToAdd.flatMap(val => val.id);
console.warn(ids)
data.forEach( user => {
Expand All @@ -186,7 +186,7 @@ export class DomainGroupViewComponent extends BaseComponent implements OnInit {
}

public saveUsers() {
this.domainGroup.accessUsers.push(...this.usersToAdd);
this.domainGroup.managers.push(...this.usersToAdd);
this.usersToAdd = [];
this.userAccessModal.hide();
}
Expand All @@ -202,7 +202,7 @@ export class DomainGroupViewComponent extends BaseComponent implements OnInit {
}

public removeMyAccess() {
this.domainGroup.accessUsers = this.domainGroup.accessUsers.filter(user => user.username !== this.authService.getUsername())
this.domainGroup.managers = this.domainGroup.managers.filter(user => user.username !== this.authService.getUsername())
this.domainService.updateDomainGroup(this.domainGroup, this.domainGroupId).subscribe(_ => {
this.router.navigate(['/admin/domains/groups'])
})
Expand Down
2 changes: 1 addition & 1 deletion src/app/model/domaingroup.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,5 +8,5 @@ export class DomainGroup {
public codename: string = undefined;
public domains: Domain[] = [];
public applicationStatePerDomain: DomainApplicationStatePerDomain[] = [];
public accessUsers: User[] = [];
public managers: User[] = [];
}

0 comments on commit d201055

Please sign in to comment.