|
|
@ -14,6 +14,7 @@ import { |
|
|
OnDestroy, |
|
|
OnDestroy, |
|
|
Output, |
|
|
Output, |
|
|
ViewChild, |
|
|
ViewChild, |
|
|
|
|
|
computed, |
|
|
inject, |
|
|
inject, |
|
|
input |
|
|
input |
|
|
} from '@angular/core'; |
|
|
} from '@angular/core'; |
|
|
@ -73,7 +74,6 @@ export class GfAccountsTableComponent implements OnChanges, OnDestroy { |
|
|
@ViewChild(MatSort) sort: MatSort; |
|
|
@ViewChild(MatSort) sort: MatSort; |
|
|
|
|
|
|
|
|
public dataSource = new MatTableDataSource<Account>(); |
|
|
public dataSource = new MatTableDataSource<Account>(); |
|
|
public displayedColumns = []; |
|
|
|
|
|
public isLoading = true; |
|
|
public isLoading = true; |
|
|
public routeQueryParams: Subscription; |
|
|
public routeQueryParams: Subscription; |
|
|
|
|
|
|
|
|
@ -84,53 +84,57 @@ export class GfAccountsTableComponent implements OnChanges, OnDestroy { |
|
|
public readonly showValue = input(true); |
|
|
public readonly showValue = input(true); |
|
|
public readonly showValueInBaseCurrency = input(false); |
|
|
public readonly showValueInBaseCurrency = input(false); |
|
|
|
|
|
|
|
|
private readonly notificationService = inject(NotificationService); |
|
|
protected readonly displayedColumns = computed(() => { |
|
|
private readonly router = inject(Router); |
|
|
const columns = ['status', 'account', 'platform']; |
|
|
private readonly unsubscribeSubject = new Subject<void>(); |
|
|
|
|
|
|
|
|
|
|
|
public constructor() { |
|
|
|
|
|
addIcons({ |
|
|
|
|
|
arrowRedoOutline, |
|
|
|
|
|
createOutline, |
|
|
|
|
|
documentTextOutline, |
|
|
|
|
|
ellipsisHorizontal, |
|
|
|
|
|
eyeOffOutline, |
|
|
|
|
|
trashOutline, |
|
|
|
|
|
walletOutline |
|
|
|
|
|
}); |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
public ngOnChanges() { |
|
|
|
|
|
this.displayedColumns = ['status', 'account', 'platform']; |
|
|
|
|
|
|
|
|
|
|
|
if (this.showActivitiesCount()) { |
|
|
if (this.showActivitiesCount()) { |
|
|
this.displayedColumns.push('activitiesCount'); |
|
|
columns.push('activitiesCount'); |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
if (this.showBalance()) { |
|
|
if (this.showBalance()) { |
|
|
this.displayedColumns.push('balance'); |
|
|
columns.push('balance'); |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
if (this.showValue()) { |
|
|
if (this.showValue()) { |
|
|
this.displayedColumns.push('value'); |
|
|
columns.push('value'); |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
this.displayedColumns.push('currency'); |
|
|
columns.push('currency'); |
|
|
|
|
|
|
|
|
if (this.showValueInBaseCurrency()) { |
|
|
if (this.showValueInBaseCurrency()) { |
|
|
this.displayedColumns.push('valueInBaseCurrency'); |
|
|
columns.push('valueInBaseCurrency'); |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
if (this.showAllocationInPercentage()) { |
|
|
if (this.showAllocationInPercentage()) { |
|
|
this.displayedColumns.push('allocation'); |
|
|
columns.push('allocation'); |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
this.displayedColumns.push('comment'); |
|
|
columns.push('comment'); |
|
|
|
|
|
|
|
|
if (this.showActions()) { |
|
|
if (this.showActions()) { |
|
|
this.displayedColumns.push('actions'); |
|
|
columns.push('actions'); |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
return columns; |
|
|
|
|
|
}); |
|
|
|
|
|
|
|
|
|
|
|
private readonly notificationService = inject(NotificationService); |
|
|
|
|
|
private readonly router = inject(Router); |
|
|
|
|
|
private readonly unsubscribeSubject = new Subject<void>(); |
|
|
|
|
|
|
|
|
|
|
|
public constructor() { |
|
|
|
|
|
addIcons({ |
|
|
|
|
|
arrowRedoOutline, |
|
|
|
|
|
createOutline, |
|
|
|
|
|
documentTextOutline, |
|
|
|
|
|
ellipsisHorizontal, |
|
|
|
|
|
eyeOffOutline, |
|
|
|
|
|
trashOutline, |
|
|
|
|
|
walletOutline |
|
|
|
|
|
}); |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
public ngOnChanges() { |
|
|
this.isLoading = true; |
|
|
this.isLoading = true; |
|
|
|
|
|
|
|
|
this.dataSource = new MatTableDataSource(this.accounts); |
|
|
this.dataSource = new MatTableDataSource(this.accounts); |
|
|
|