Browse Source

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

* Use application version from API endpoint

---------

Co-authored-by: Thomas <4159106+dtslvr@users.noreply.github.com>
pull/2443/head
Akshay Wadatkar 1 year ago
committed by GitHub
parent
commit
fda4e0ea7d
No known key found for this signature in database GPG Key ID: 4AEE18F83AFDEB23
  1. 23
      apps/client/src/app/components/admin-overview/admin-overview.component.ts
  2. 4
      apps/client/src/app/components/admin-overview/admin-overview.html

23
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 transactionCount: number;
public userCount: number; public userCount: number;
public user: User; public user: User;
public version = environment.version; public version: string;
private unsubscribeSubject = new Subject<void>(); private unsubscribeSubject = new Subject<void>();
@ -204,15 +204,18 @@ export class AdminOverviewComponent implements OnDestroy, OnInit {
this.adminService this.adminService
.fetchAdminData() .fetchAdminData()
.pipe(takeUntil(this.unsubscribeSubject)) .pipe(takeUntil(this.unsubscribeSubject))
.subscribe(({ exchangeRates, settings, transactionCount, userCount }) => { .subscribe(
this.coupons = (settings[PROPERTY_COUPONS] as Coupon[]) ?? []; ({ exchangeRates, settings, transactionCount, userCount, version }) => {
this.customCurrencies = settings[PROPERTY_CURRENCIES] as string[]; this.coupons = (settings[PROPERTY_COUPONS] as Coupon[]) ?? [];
this.exchangeRates = exchangeRates; this.customCurrencies = settings[PROPERTY_CURRENCIES] as string[];
this.transactionCount = transactionCount; this.exchangeRates = exchangeRates;
this.userCount = userCount; this.transactionCount = transactionCount;
this.userCount = userCount;
this.changeDetectorRef.markForCheck(); this.version = version;
});
this.changeDetectorRef.markForCheck();
}
);
} }
private generateCouponCode(aLength: number) { private generateCouponCode(aLength: number) {

4
apps/client/src/app/components/admin-overview/admin-overview.html

@ -5,7 +5,9 @@
<mat-card-content> <mat-card-content>
<div class="d-flex my-3"> <div class="d-flex my-3">
<div class="w-50" i18n>Version</div> <div class="w-50" i18n>Version</div>
<div class="w-50">{{ version }}</div> <div class="w-50">
<gf-value [value]="version" />
</div>
</div> </div>
<div class="d-flex my-3"> <div class="d-flex my-3">
<div class="w-50" i18n>User Count</div> <div class="w-50" i18n>User Count</div>

Loading…
Cancel
Save