|
|
@ -31,7 +31,7 @@ import { |
|
|
DestroyRef, |
|
|
DestroyRef, |
|
|
inject, |
|
|
inject, |
|
|
OnInit, |
|
|
OnInit, |
|
|
ViewChild |
|
|
viewChild |
|
|
} from '@angular/core'; |
|
|
} from '@angular/core'; |
|
|
import { takeUntilDestroyed } from '@angular/core/rxjs-interop'; |
|
|
import { takeUntilDestroyed } from '@angular/core/rxjs-interop'; |
|
|
import { MatButtonModule } from '@angular/material/button'; |
|
|
import { MatButtonModule } from '@angular/material/button'; |
|
|
@ -80,8 +80,6 @@ import { switchMap, tap } from 'rxjs/operators'; |
|
|
templateUrl: './admin-users.html' |
|
|
templateUrl: './admin-users.html' |
|
|
}) |
|
|
}) |
|
|
export class GfAdminUsersComponent implements OnInit { |
|
|
export class GfAdminUsersComponent implements OnInit { |
|
|
@ViewChild(MatPaginator) paginator: MatPaginator; |
|
|
|
|
|
|
|
|
|
|
|
public dataSource = new MatTableDataSource<AdminUsersResponse['users'][0]>(); |
|
|
public dataSource = new MatTableDataSource<AdminUsersResponse['users'][0]>(); |
|
|
public defaultDateFormat: string; |
|
|
public defaultDateFormat: string; |
|
|
public deviceType: string; |
|
|
public deviceType: string; |
|
|
@ -97,6 +95,8 @@ export class GfAdminUsersComponent implements OnInit { |
|
|
public totalItems = 0; |
|
|
public totalItems = 0; |
|
|
public user: User; |
|
|
public user: User; |
|
|
|
|
|
|
|
|
|
|
|
private readonly paginator = viewChild.required(MatPaginator); |
|
|
|
|
|
|
|
|
private readonly adminService = inject(AdminService); |
|
|
private readonly adminService = inject(AdminService); |
|
|
private readonly changeDetectorRef = inject(ChangeDetectorRef); |
|
|
private readonly changeDetectorRef = inject(ChangeDetectorRef); |
|
|
private readonly dataService = inject(DataService); |
|
|
private readonly dataService = inject(DataService); |
|
|
@ -266,8 +266,8 @@ export class GfAdminUsersComponent implements OnInit { |
|
|
private fetchUsers({ pageIndex }: { pageIndex: number } = { pageIndex: 0 }) { |
|
|
private fetchUsers({ pageIndex }: { pageIndex: number } = { pageIndex: 0 }) { |
|
|
this.isLoading = true; |
|
|
this.isLoading = true; |
|
|
|
|
|
|
|
|
if (pageIndex === 0 && this.paginator) { |
|
|
if (pageIndex === 0 && this.paginator()) { |
|
|
this.paginator.pageIndex = 0; |
|
|
this.paginator().pageIndex = 0; |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
this.adminService |
|
|
this.adminService |
|
|
|