|
|
@ -1,6 +1,9 @@ |
|
|
import { GfInvestmentChartComponent } from '@ghostfolio/client/components/investment-chart/investment-chart.component'; |
|
|
import { GfInvestmentChartComponent } from '@ghostfolio/client/components/investment-chart/investment-chart.component'; |
|
|
import { UserService } from '@ghostfolio/client/services/user/user.service'; |
|
|
import { UserService } from '@ghostfolio/client/services/user/user.service'; |
|
|
import { NUMERICAL_PRECISION_THRESHOLD_6_FIGURES } from '@ghostfolio/common/config'; |
|
|
import { |
|
|
|
|
|
DEFAULT_PAGE_SIZE, |
|
|
|
|
|
NUMERICAL_PRECISION_THRESHOLD_6_FIGURES |
|
|
|
|
|
} from '@ghostfolio/common/config'; |
|
|
import { CreateAccountBalanceDto } from '@ghostfolio/common/dtos'; |
|
|
import { CreateAccountBalanceDto } from '@ghostfolio/common/dtos'; |
|
|
import { DATE_FORMAT, downloadAsFile } from '@ghostfolio/common/helper'; |
|
|
import { DATE_FORMAT, downloadAsFile } from '@ghostfolio/common/helper'; |
|
|
import { |
|
|
import { |
|
|
@ -33,6 +36,7 @@ import { takeUntilDestroyed } from '@angular/core/rxjs-interop'; |
|
|
import { MatButtonModule } from '@angular/material/button'; |
|
|
import { MatButtonModule } from '@angular/material/button'; |
|
|
import { MAT_DIALOG_DATA, MatDialogRef } from '@angular/material/dialog'; |
|
|
import { MAT_DIALOG_DATA, MatDialogRef } from '@angular/material/dialog'; |
|
|
import { MatDialogModule } from '@angular/material/dialog'; |
|
|
import { MatDialogModule } from '@angular/material/dialog'; |
|
|
|
|
|
import { PageEvent } from '@angular/material/paginator'; |
|
|
import { Sort, SortDirection } from '@angular/material/sort'; |
|
|
import { Sort, SortDirection } from '@angular/material/sort'; |
|
|
import { MatTableDataSource } from '@angular/material/table'; |
|
|
import { MatTableDataSource } from '@angular/material/table'; |
|
|
import { MatTabsModule } from '@angular/material/tabs'; |
|
|
import { MatTabsModule } from '@angular/material/tabs'; |
|
|
@ -93,6 +97,8 @@ export class GfAccountDetailDialogComponent implements OnInit { |
|
|
protected isLoadingActivities: boolean; |
|
|
protected isLoadingActivities: boolean; |
|
|
protected isLoadingChart: boolean; |
|
|
protected isLoadingChart: boolean; |
|
|
protected name: string | null; |
|
|
protected name: string | null; |
|
|
|
|
|
protected pageIndex = 0; |
|
|
|
|
|
protected pageSize = DEFAULT_PAGE_SIZE; |
|
|
protected platformName: string; |
|
|
protected platformName: string; |
|
|
protected sortColumn = 'date'; |
|
|
protected sortColumn = 'date'; |
|
|
protected sortDirection: SortDirection = 'desc'; |
|
|
protected sortDirection: SortDirection = 'desc'; |
|
|
@ -133,6 +139,21 @@ export class GfAccountDetailDialogComponent implements OnInit { |
|
|
this.initialize(); |
|
|
this.initialize(); |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
protected onAddAccountBalance(accountBalance: CreateAccountBalanceDto) { |
|
|
|
|
|
this.dataService |
|
|
|
|
|
.postAccountBalance(accountBalance) |
|
|
|
|
|
.pipe(takeUntilDestroyed(this.destroyRef)) |
|
|
|
|
|
.subscribe(() => { |
|
|
|
|
|
this.initialize(); |
|
|
|
|
|
}); |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
protected onChangePage(page: PageEvent) { |
|
|
|
|
|
this.pageIndex = page.pageIndex; |
|
|
|
|
|
|
|
|
|
|
|
this.fetchActivities(); |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
protected onCloneActivity(aActivity: Activity) { |
|
|
protected onCloneActivity(aActivity: Activity) { |
|
|
this.router.navigate( |
|
|
this.router.navigate( |
|
|
internalRoutes.portfolio.subRoutes.activities.routerLink, |
|
|
internalRoutes.portfolio.subRoutes.activities.routerLink, |
|
|
@ -148,15 +169,6 @@ export class GfAccountDetailDialogComponent implements OnInit { |
|
|
this.dialogRef.close(); |
|
|
this.dialogRef.close(); |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
protected onAddAccountBalance(accountBalance: CreateAccountBalanceDto) { |
|
|
|
|
|
this.dataService |
|
|
|
|
|
.postAccountBalance(accountBalance) |
|
|
|
|
|
.pipe(takeUntilDestroyed(this.destroyRef)) |
|
|
|
|
|
.subscribe(() => { |
|
|
|
|
|
this.initialize(); |
|
|
|
|
|
}); |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
protected onDeleteAccountBalance(aId: string) { |
|
|
protected onDeleteAccountBalance(aId: string) { |
|
|
this.dataService |
|
|
this.dataService |
|
|
.deleteAccountBalance(aId) |
|
|
.deleteAccountBalance(aId) |
|
|
@ -287,8 +299,10 @@ export class GfAccountDetailDialogComponent implements OnInit { |
|
|
this.dataService |
|
|
this.dataService |
|
|
.fetchActivities({ |
|
|
.fetchActivities({ |
|
|
filters: [{ id: this.data.accountId, type: 'ACCOUNT' }], |
|
|
filters: [{ id: this.data.accountId, type: 'ACCOUNT' }], |
|
|
|
|
|
skip: this.pageIndex * this.pageSize, |
|
|
sortColumn: this.sortColumn, |
|
|
sortColumn: this.sortColumn, |
|
|
sortDirection: this.sortDirection |
|
|
sortDirection: this.sortDirection, |
|
|
|
|
|
take: this.pageSize |
|
|
}) |
|
|
}) |
|
|
.pipe(takeUntilDestroyed(this.destroyRef)) |
|
|
.pipe(takeUntilDestroyed(this.destroyRef)) |
|
|
.subscribe(({ activities, count }) => { |
|
|
.subscribe(({ activities, count }) => { |
|
|
|