Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(#2493): Trigger filter when deselecting users #2494

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ <h4>{{ headerTitle }}</h4>
*ngIf="!permission.publicElement"
>
<span class="general-options-header">Users</span>
<mat-form-field class="example-chip-list" color="accent">
<mat-form-field color="accent">
<mat-label>Authorized Users</mat-label>
<mat-chip-grid #chipList aria-label="User selection">
<mat-chip-row
Expand Down Expand Up @@ -88,7 +88,7 @@ <h4>{{ headerTitle }}</h4>
*ngIf="!permission.publicElement"
>
<span class="general-options-header">Groups</span>
<mat-form-field class="example-chip-list" color="accent">
<mat-form-field color="accent">
<mat-label>Authorized Groups</mat-label>
<mat-chip-grid #chipList aria-label="Group selection">
<mat-chip-row
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,15 +26,14 @@ import {
Validators,
} from '@angular/forms';
import {
PermissionsService,
Group,
Permission,
PermissionEntry,
PermissionsService,
ServiceAccount,
UserAccount,
UserService,
UserGroupService,
UserAdminService,
UserGroupService,
} from '@streampipes/platform-services';
import { MatChipInputEvent } from '@angular/material/chips';
import { Observable, zip } from 'rxjs';
Expand Down Expand Up @@ -80,7 +79,6 @@ export class ObjectPermissionDialogComponent implements OnInit {
private fb: UntypedFormBuilder,
private dialogRef: DialogRef<ObjectPermissionDialogComponent>,
private permissionsService: PermissionsService,
private userService: UserService,
private userAdminService: UserAdminService,
private groupService: UserGroupService,
) {
Expand Down Expand Up @@ -198,13 +196,15 @@ export class ObjectPermissionDialogComponent implements OnInit {
u => u.principalId === user.principalId,
);
this.grantedUserAuthorities.splice(currentIndex, 1);
this.userCtrl.setValue(null);
}

removeGroup(group: Group) {
const currentIndex = this.grantedGroupAuthorities.findIndex(
u => u.groupId === group.groupId,
);
this.grantedGroupAuthorities.splice(currentIndex, 1);
this.groupCtrl.setValue(null);
}

addUser(event: MatChipInputEvent) {
Expand Down
Loading