diff --git a/frontend/src/app/users/user-settings/user-settings.component.html b/frontend/src/app/users/user-settings/user-settings.component.html index 10e82e5a5..a6d4c080a 100644 --- a/frontend/src/app/users/user-settings/user-settings.component.html +++ b/frontend/src/app/users/user-settings/user-settings.component.html @@ -11,17 +11,29 @@

Manage Users

{{ users.length }} registered users } +
+ + Search + + search + - - Search - - search - +
+ + Normal + +
+ scienceBeta Tester +
+
+
+
+
@for (role of userRoles; track role) { @@ -43,7 +55,8 @@

Manage Users

{{ user.name }}
- {{ roleMapping[user.role] }} + {{ roleMapping[user.role] }} | + {{ user.beta_tester ? "Beta Tester" : "" }}
diff --git a/frontend/src/app/users/user-settings/user-settings.component.ts b/frontend/src/app/users/user-settings/user-settings.component.ts index 636954907..ee0dc713a 100644 --- a/frontend/src/app/users/user-settings/user-settings.component.ts +++ b/frontend/src/app/users/user-settings/user-settings.component.ts @@ -15,6 +15,7 @@ import { AsyncValidatorFn, } from '@angular/forms'; import { MatIconButton, MatButton } from '@angular/material/button'; +import { MatChipListbox, MatChipOption } from '@angular/material/chips'; import { MatDialog } from '@angular/material/dialog'; import { MatFormField, @@ -59,11 +60,11 @@ import { UserWrapperService } from 'src/app/users/user-wrapper/user-wrapper.serv MatButton, AsyncPipe, NgxSkeletonLoaderModule, + MatChipListbox, + MatChipOption, ], }) export class UserSettingsComponent implements OnInit { - search = ''; - public readonly roleMapping = { user: 'Global User', administrator: 'Global Administrator', @@ -80,6 +81,11 @@ export class UserSettingsComponent implements OnInit { }), }); + form = new FormGroup({ + search: new FormControl(''), + userType: new FormControl(null), + }); + constructor( public ownUserService: OwnUserWrapperService, public userWrapperService: UserWrapperService, @@ -252,10 +258,12 @@ export class UserSettingsComponent implements OnInit { users: User[] | null | undefined, role: UserRole, ): User[] | undefined { - return users?.filter( - (user) => - user.role == role && - user.name.toLowerCase().includes(this.search.toLowerCase()), + return users?.filter((user) => + user.role == role && + user.name.toLowerCase().includes(this.form.value.search.toLowerCase()) && + this.form.value.userType + ? user.beta_tester == (this.form.value.userType == 'beta') + : true, ); } }