Browse Source

Feature/add refresh action to user detail dialog menu in admin control (#7978)

* Add refresh action

* Update changelog
pull/7985/head
Thomas Kaul 1 week ago
committed by GitHub
parent
commit
d4e2adc6df
No known key found for this signature in database GPG Key ID: B5690EEEBB952194
  1. 1
      CHANGELOG.md
  2. 44
      apps/client/src/app/components/user-detail-dialog/user-detail-dialog.component.ts
  3. 4
      apps/client/src/app/components/user-detail-dialog/user-detail-dialog.html

1
CHANGELOG.md

@ -9,6 +9,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
### Added
- Added a _Refresh_ action to the user detail dialog menu in the admin control panel
- Added the total column to the table of the tag management in the admin control panel
### Changed

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