Skip to content

Open Source Wealth Management Software. Angular + NestJS + Prisma + Nx + TypeScript 🤍

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

Thomas Kauld4e2adc6dff1
diff --git a/CHANGELOG.md b/CHANGELOG.md
index b2b3725a97..a2759a3acd 100644
--- a/CHANGELOG.md
+++ b/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
diff --git a/apps/client/src/app/components/user-detail-dialog/user-detail-dialog.component.ts b/apps/client/src/app/components/user-detail-dialog/user-detail-dialog.component.ts
index 926fb8d8cd..8d12d0ba03 100644
--- a/apps/client/src/app/components/user-detail-dialog/user-detail-dialog.component.ts
+++ b/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();
}
diff --git a/apps/client/src/app/components/user-detail-dialog/user-detail-dialog.html b/apps/client/src/app/components/user-detail-dialog/user-detail-dialog.html
index efc4fe5b43..4cc5b8a260 100644
--- a/apps/client/src/app/components/user-detail-dialog/user-detail-dialog.html
+++ b/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"