Skip to content

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

Use application version from API endpoint in Admin Control panel (#2427)

Akshay Wadatkarfda4e0ea7d85
diff --git a/apps/client/src/app/components/admin-overview/admin-overview.component.ts b/apps/client/src/app/components/admin-overview/admin-overview.component.ts
index 2ca3f0724c..b1e91dfc9d 100644
--- a/apps/client/src/app/components/admin-overview/admin-overview.component.ts
+++ b/apps/client/src/app/components/admin-overview/admin-overview.component.ts
@@ -43,7 +43,7 @@ export class AdminOverviewComponent implements OnDestroy, OnInit {
public transactionCount: number;
public userCount: number;
public user: User;
- public version = environment.version;
+ public version: string;
private unsubscribeSubject = new Subject<void>();
@@ -204,15 +204,18 @@ export class AdminOverviewComponent implements OnDestroy, OnInit {
this.adminService
.fetchAdminData()
.pipe(takeUntil(this.unsubscribeSubject))
- .subscribe(({ exchangeRates, settings, transactionCount, userCount }) => {
- this.coupons = (settings[PROPERTY_COUPONS] as Coupon[]) ?? [];
- this.customCurrencies = settings[PROPERTY_CURRENCIES] as string[];
- this.exchangeRates = exchangeRates;
- this.transactionCount = transactionCount;
- this.userCount = userCount;
-
- this.changeDetectorRef.markForCheck();
- });
+ .subscribe(
+ ({ exchangeRates, settings, transactionCount, userCount, version }) => {
+ this.coupons = (settings[PROPERTY_COUPONS] as Coupon[]) ?? [];
+ this.customCurrencies = settings[PROPERTY_CURRENCIES] as string[];
+ this.exchangeRates = exchangeRates;
+ this.transactionCount = transactionCount;
+ this.userCount = userCount;
+ this.version = version;
+
+ this.changeDetectorRef.markForCheck();
+ }
+ );
}
private generateCouponCode(aLength: number) {
diff --git a/apps/client/src/app/components/admin-overview/admin-overview.html b/apps/client/src/app/components/admin-overview/admin-overview.html
index e54f8f27b6..47f27dd40b 100644
--- a/apps/client/src/app/components/admin-overview/admin-overview.html
+++ b/apps/client/src/app/components/admin-overview/admin-overview.html
@@ -5,7 +5,9 @@
<mat-card-content>
<div class="d-flex my-3">
<div class="w-50" i18n>Version</div>
- <div class="w-50">{{ version }}</div>
+ <div class="w-50">
+ <gf-value [value]="version" />
+ </div>
</div>
<div class="d-flex my-3">
<div class="w-50" i18n>User Count</div>