Browse Source

Add refresh action

pull/7978/head
Thomas Kaul 2 weeks ago
parent
commit
4c62a043ef
  1. 44
      apps/client/src/app/components/user-detail-dialog/user-detail-dialog.component.ts
  2. 4
      apps/client/src/app/components/user-detail-dialog/user-detail-dialog.html

44
apps/client/src/app/components/user-detail-dialog/user-detail-dialog.component.ts

@ -91,25 +91,7 @@ export class GfUserDetailDialogComponent implements OnInit {
}
public ngOnInit() {
this.adminService
.fetchUserById(this.data.userId)
.pipe(
takeUntilDestroyed(this.destroyRef),
catchError(() => {
this.dialogRef.close();
return EMPTY;
})
)
.subscribe((user) => {
this.user = user;
this.subscriptionsDataSource.data = this.user.subscriptions ?? [];
this.isLoading = false;
this.changeDetectorRef.markForCheck();
});
this.initialize();
}
protected deleteUser() {
@ -141,6 +123,30 @@ export class GfUserDetailDialogComponent implements OnInit {
: $localize`Coupon`;
}
protected initialize() {
this.isLoading = true;
this.adminService
.fetchUserById(this.data.userId)
.pipe(
takeUntilDestroyed(this.destroyRef),
catchError(() => {
this.dialogRef.close();
return EMPTY;
})
)
.subscribe((user) => {
this.user = user;
this.subscriptionsDataSource.data = this.user.subscriptions ?? [];
this.isLoading = false;
this.changeDetectorRef.markForCheck();
});
}
protected onClose() {
this.dialogRef.close();
}

4
apps/client/src/app/components/user-detail-dialog/user-detail-dialog.html

@ -13,6 +13,10 @@
class="no-max-width"
xPosition="before"
>
<button mat-menu-item type="button" (click)="initialize()">
<ng-container i18n>Refresh</ng-container>
</button>
<hr class="m-0" />
<button
mat-menu-item
type="button"

Loading…
Cancel
Save