Feature/refactor unique asset type to asset profile identifier (#3636)
* Refactoring
This commit is contained in:
@@ -3,7 +3,7 @@ import { GfAssetProfileIconComponent } from '@ghostfolio/client/components/asset
|
||||
import { GfSymbolModule } from '@ghostfolio/client/pipes/symbol/symbol.module';
|
||||
import { DEFAULT_PAGE_SIZE } from '@ghostfolio/common/config';
|
||||
import { getDateFormatString, getLocale } from '@ghostfolio/common/helper';
|
||||
import { UniqueAsset } from '@ghostfolio/common/interfaces';
|
||||
import { AssetProfileIdentifier } from '@ghostfolio/common/interfaces';
|
||||
import { OrderWithAccount } from '@ghostfolio/common/types';
|
||||
import { GfActivityTypeComponent } from '@ghostfolio/ui/activity-type';
|
||||
import { GfNoTransactionsInfoComponent } from '@ghostfolio/ui/no-transactions-info';
|
||||
@@ -99,7 +99,7 @@ export class GfActivitiesTableComponent
|
||||
@Output() export = new EventEmitter<void>();
|
||||
@Output() exportDrafts = new EventEmitter<string[]>();
|
||||
@Output() import = new EventEmitter<void>();
|
||||
@Output() importDividends = new EventEmitter<UniqueAsset>();
|
||||
@Output() importDividends = new EventEmitter<AssetProfileIdentifier>();
|
||||
@Output() pageChanged = new EventEmitter<PageEvent>();
|
||||
@Output() selectedActivities = new EventEmitter<Activity[]>();
|
||||
@Output() sortChanged = new EventEmitter<Sort>();
|
||||
@@ -263,7 +263,7 @@ export class GfActivitiesTableComponent
|
||||
alert(aComment);
|
||||
}
|
||||
|
||||
public onOpenPositionDialog({ dataSource, symbol }: UniqueAsset) {
|
||||
public onOpenPositionDialog({ dataSource, symbol }: AssetProfileIdentifier) {
|
||||
this.router.navigate([], {
|
||||
queryParams: { dataSource, symbol, holdingDetailDialog: true }
|
||||
});
|
||||
|
@@ -1,4 +1,4 @@
|
||||
import { UniqueAsset } from '@ghostfolio/common/interfaces';
|
||||
import { AssetProfileIdentifier } from '@ghostfolio/common/interfaces';
|
||||
import { DateRange } from '@ghostfolio/common/types';
|
||||
|
||||
export interface IDateRangeOption {
|
||||
@@ -6,7 +6,7 @@ export interface IDateRangeOption {
|
||||
value: DateRange;
|
||||
}
|
||||
|
||||
export interface ISearchResultItem extends UniqueAsset {
|
||||
export interface ISearchResultItem extends AssetProfileIdentifier {
|
||||
assetSubClassString: string;
|
||||
currency: string;
|
||||
name: string;
|
||||
|
@@ -1,5 +1,9 @@
|
||||
import { getLocale, resolveMarketCondition } from '@ghostfolio/common/helper';
|
||||
import { Benchmark, UniqueAsset, User } from '@ghostfolio/common/interfaces';
|
||||
import {
|
||||
AssetProfileIdentifier,
|
||||
Benchmark,
|
||||
User
|
||||
} from '@ghostfolio/common/interfaces';
|
||||
import { translate } from '@ghostfolio/ui/i18n';
|
||||
import { GfTrendIndicatorComponent } from '@ghostfolio/ui/trend-indicator';
|
||||
import { GfValueComponent } from '@ghostfolio/ui/value';
|
||||
@@ -84,7 +88,7 @@ export class GfBenchmarkComponent implements OnChanges, OnDestroy {
|
||||
}
|
||||
}
|
||||
|
||||
public onOpenBenchmarkDialog({ dataSource, symbol }: UniqueAsset) {
|
||||
public onOpenBenchmarkDialog({ dataSource, symbol }: AssetProfileIdentifier) {
|
||||
this.router.navigate([], {
|
||||
queryParams: { dataSource, symbol, benchmarkDetailDialog: true }
|
||||
});
|
||||
@@ -95,7 +99,10 @@ export class GfBenchmarkComponent implements OnChanges, OnDestroy {
|
||||
this.unsubscribeSubject.complete();
|
||||
}
|
||||
|
||||
private openBenchmarkDetailDialog({ dataSource, symbol }: UniqueAsset) {
|
||||
private openBenchmarkDetailDialog({
|
||||
dataSource,
|
||||
symbol
|
||||
}: AssetProfileIdentifier) {
|
||||
const dialogRef = this.dialog.open(GfBenchmarkDetailDialogComponent, {
|
||||
data: <BenchmarkDetailDialogParams>{
|
||||
dataSource,
|
||||
|
@@ -2,7 +2,10 @@ import { GfAssetProfileIconComponent } from '@ghostfolio/client/components/asset
|
||||
import { GfHoldingDetailDialogComponent } from '@ghostfolio/client/components/holding-detail-dialog/holding-detail-dialog.component';
|
||||
import { GfSymbolModule } from '@ghostfolio/client/pipes/symbol/symbol.module';
|
||||
import { getLocale } from '@ghostfolio/common/helper';
|
||||
import { PortfolioPosition, UniqueAsset } from '@ghostfolio/common/interfaces';
|
||||
import {
|
||||
AssetProfileIdentifier,
|
||||
PortfolioPosition
|
||||
} from '@ghostfolio/common/interfaces';
|
||||
import { GfNoTransactionsInfoComponent } from '@ghostfolio/ui/no-transactions-info';
|
||||
import { GfValueComponent } from '@ghostfolio/ui/value';
|
||||
|
||||
@@ -102,7 +105,7 @@ export class GfHoldingsTableComponent implements OnChanges, OnDestroy, OnInit {
|
||||
}
|
||||
}
|
||||
|
||||
public onOpenHoldingDialog({ dataSource, symbol }: UniqueAsset) {
|
||||
public onOpenHoldingDialog({ dataSource, symbol }: AssetProfileIdentifier) {
|
||||
if (this.hasPermissionToOpenDetails) {
|
||||
this.router.navigate([], {
|
||||
queryParams: { dataSource, symbol, holdingDetailDialog: true }
|
||||
|
@@ -1,7 +1,10 @@
|
||||
import { getTooltipOptions } from '@ghostfolio/common/chart-helper';
|
||||
import { UNKNOWN_KEY } from '@ghostfolio/common/config';
|
||||
import { getLocale, getTextColor } from '@ghostfolio/common/helper';
|
||||
import { PortfolioPosition, UniqueAsset } from '@ghostfolio/common/interfaces';
|
||||
import {
|
||||
AssetProfileIdentifier,
|
||||
PortfolioPosition
|
||||
} from '@ghostfolio/common/interfaces';
|
||||
import { ColorScheme } from '@ghostfolio/common/types';
|
||||
import { translate } from '@ghostfolio/ui/i18n';
|
||||
|
||||
@@ -71,7 +74,7 @@ export class GfPortfolioProportionChartComponent
|
||||
};
|
||||
} = {};
|
||||
|
||||
@Output() proportionChartClicked = new EventEmitter<UniqueAsset>();
|
||||
@Output() proportionChartClicked = new EventEmitter<AssetProfileIdentifier>();
|
||||
|
||||
@ViewChild('chartCanvas') chartCanvas: ElementRef<HTMLCanvasElement>;
|
||||
|
||||
|
@@ -1,5 +1,8 @@
|
||||
import { getAnnualizedPerformancePercent } from '@ghostfolio/common/calculation-helper';
|
||||
import { PortfolioPosition, UniqueAsset } from '@ghostfolio/common/interfaces';
|
||||
import {
|
||||
AssetProfileIdentifier,
|
||||
PortfolioPosition
|
||||
} from '@ghostfolio/common/interfaces';
|
||||
|
||||
import { CommonModule } from '@angular/common';
|
||||
import {
|
||||
@@ -40,7 +43,7 @@ export class GfTreemapChartComponent
|
||||
@Input() cursor: string;
|
||||
@Input() holdings: PortfolioPosition[];
|
||||
|
||||
@Output() treemapChartClicked = new EventEmitter<UniqueAsset>();
|
||||
@Output() treemapChartClicked = new EventEmitter<AssetProfileIdentifier>();
|
||||
|
||||
@ViewChild('chartCanvas') chartCanvas: ElementRef<HTMLCanvasElement>;
|
||||
|
||||
|
Reference in New Issue
Block a user