|
|
@ -49,16 +49,16 @@ import { |
|
|
templateUrl: './user-detail-dialog.html' |
|
|
templateUrl: './user-detail-dialog.html' |
|
|
}) |
|
|
}) |
|
|
export class GfUserDetailDialogComponent implements OnInit { |
|
|
export class GfUserDetailDialogComponent implements OnInit { |
|
|
public baseCurrency: string; |
|
|
protected baseCurrency: string; |
|
|
public readonly getCountryName = getCountryName; |
|
|
protected readonly getCountryName = getCountryName; |
|
|
public subscriptionsDataSource = new MatTableDataSource<Subscription>(); |
|
|
protected subscriptionsDataSource = new MatTableDataSource<Subscription>(); |
|
|
public subscriptionsDisplayedColumns = [ |
|
|
protected subscriptionsDisplayedColumns = [ |
|
|
'createdAt', |
|
|
'createdAt', |
|
|
'type', |
|
|
'type', |
|
|
'price', |
|
|
'price', |
|
|
'expiresAt' |
|
|
'expiresAt' |
|
|
]; |
|
|
]; |
|
|
public user: AdminUserResponse; |
|
|
protected user: AdminUserResponse; |
|
|
|
|
|
|
|
|
public constructor( |
|
|
public constructor( |
|
|
private adminService: AdminService, |
|
|
private adminService: AdminService, |
|
|
@ -98,14 +98,14 @@ export class GfUserDetailDialogComponent implements OnInit { |
|
|
}); |
|
|
}); |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
public deleteUser() { |
|
|
protected deleteUser() { |
|
|
this.dialogRef.close({ |
|
|
this.dialogRef.close({ |
|
|
action: 'delete', |
|
|
action: 'delete', |
|
|
userId: this.data.userId |
|
|
userId: this.data.userId |
|
|
}); |
|
|
}); |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
public getSum() { |
|
|
protected getSum() { |
|
|
const prices = this.subscriptionsDataSource.data.reduce<Big[]>( |
|
|
const prices = this.subscriptionsDataSource.data.reduce<Big[]>( |
|
|
(acc, { price }) => { |
|
|
(acc, { price }) => { |
|
|
if (price !== null) { |
|
|
if (price !== null) { |
|
|
@ -119,7 +119,7 @@ export class GfUserDetailDialogComponent implements OnInit { |
|
|
return getSum(prices).toNumber(); |
|
|
return getSum(prices).toNumber(); |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
public getType({ createdAt, expiresAt, price }: Subscription) { |
|
|
protected getType({ createdAt, expiresAt, price }: Subscription) { |
|
|
if (price) { |
|
|
if (price) { |
|
|
return $localize`Paid`; |
|
|
return $localize`Paid`; |
|
|
} |
|
|
} |
|
|
@ -129,7 +129,7 @@ export class GfUserDetailDialogComponent implements OnInit { |
|
|
: $localize`Coupon`; |
|
|
: $localize`Coupon`; |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
public onClose() { |
|
|
protected onClose() { |
|
|
this.dialogRef.close(); |
|
|
this.dialogRef.close(); |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
|