|
|
@ -66,7 +66,7 @@ import ms from 'ms'; |
|
|
import { DeviceDetectorService } from 'ngx-device-detector'; |
|
|
import { DeviceDetectorService } from 'ngx-device-detector'; |
|
|
import { NgxSkeletonLoaderModule } from 'ngx-skeleton-loader'; |
|
|
import { NgxSkeletonLoaderModule } from 'ngx-skeleton-loader'; |
|
|
import { interval } from 'rxjs'; |
|
|
import { interval } from 'rxjs'; |
|
|
import { switchMap, tap } from 'rxjs/operators'; |
|
|
import { distinctUntilChanged, map, switchMap, tap } from 'rxjs/operators'; |
|
|
|
|
|
|
|
|
@Component({ |
|
|
@Component({ |
|
|
changeDetection: ChangeDetectionStrategy.OnPush, |
|
|
changeDetection: ChangeDetectionStrategy.OnPush, |
|
|
@ -173,11 +173,13 @@ export class GfAdminUsersComponent implements OnInit { |
|
|
this.changeDetectorRef.markForCheck(); |
|
|
this.changeDetectorRef.markForCheck(); |
|
|
} |
|
|
} |
|
|
}), |
|
|
}), |
|
|
switchMap(() => this.route.paramMap) |
|
|
switchMap(() => this.route.paramMap), |
|
|
|
|
|
map((params) => { |
|
|
|
|
|
return params.get('userId'); |
|
|
|
|
|
}), |
|
|
|
|
|
distinctUntilChanged() |
|
|
) |
|
|
) |
|
|
.subscribe((params) => { |
|
|
.subscribe((userId) => { |
|
|
const userId = params.get('userId'); |
|
|
|
|
|
|
|
|
|
|
|
if (userId) { |
|
|
if (userId) { |
|
|
this.openUserDetailDialog(userId); |
|
|
this.openUserDetailDialog(userId); |
|
|
} |
|
|
} |
|
|
@ -236,12 +238,17 @@ export class GfAdminUsersComponent implements OnInit { |
|
|
.deleteUser(aId) |
|
|
.deleteUser(aId) |
|
|
.pipe(takeUntilDestroyed(this.destroyRef)) |
|
|
.pipe(takeUntilDestroyed(this.destroyRef)) |
|
|
.subscribe(() => { |
|
|
.subscribe(() => { |
|
|
this.router.navigate(['..'], { relativeTo: this.route }); |
|
|
this.router.navigate(this.routerLinkAdminControlUsers); |
|
|
|
|
|
|
|
|
|
|
|
this.fetchUsers({ |
|
|
|
|
|
pageIndex: this.paginator().pageIndex, |
|
|
|
|
|
showLoading: false |
|
|
|
|
|
}); |
|
|
}); |
|
|
}); |
|
|
}, |
|
|
}, |
|
|
confirmType: ConfirmationDialogType.Warn, |
|
|
confirmType: ConfirmationDialogType.Warn, |
|
|
discardFn: () => { |
|
|
discardFn: () => { |
|
|
this.router.navigate(['..'], { relativeTo: this.route }); |
|
|
this.router.navigate(this.routerLinkAdminControlUsers); |
|
|
}, |
|
|
}, |
|
|
title: $localize`Do you really want to delete this user?` |
|
|
title: $localize`Do you really want to delete this user?` |
|
|
}); |
|
|
}); |
|
|
@ -283,9 +290,7 @@ export class GfAdminUsersComponent implements OnInit { |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
protected onOpenUserDetailDialog(userId: string) { |
|
|
protected onOpenUserDetailDialog(userId: string) { |
|
|
this.router.navigate( |
|
|
this.router.navigate(this.routerLinkAdminControlUsers.concat(userId)); |
|
|
internalRoutes.adminControl.subRoutes.users.routerLink.concat(userId) |
|
|
|
|
|
); |
|
|
|
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
private fetchUsers({ |
|
|
private fetchUsers({ |
|
|
@ -341,9 +346,7 @@ export class GfAdminUsersComponent implements OnInit { |
|
|
if (data?.action === 'delete' && data?.userId) { |
|
|
if (data?.action === 'delete' && data?.userId) { |
|
|
this.onDeleteUser(data.userId); |
|
|
this.onDeleteUser(data.userId); |
|
|
} else { |
|
|
} else { |
|
|
this.router.navigate( |
|
|
this.router.navigate(this.routerLinkAdminControlUsers); |
|
|
internalRoutes.adminControl.subRoutes.users.routerLink |
|
|
|
|
|
); |
|
|
|
|
|
} |
|
|
} |
|
|
}); |
|
|
}); |
|
|
} |
|
|
} |
|
|
|