|
|
@ -13,6 +13,7 @@ import { |
|
|
import { AdminMarketDataItem } from '@ghostfolio/common/interfaces/admin-market-data.interface'; |
|
|
import { AdminMarketDataItem } from '@ghostfolio/common/interfaces/admin-market-data.interface'; |
|
|
import { hasPermission, permissions } from '@ghostfolio/common/permissions'; |
|
|
import { hasPermission, permissions } from '@ghostfolio/common/permissions'; |
|
|
import { GfSymbolPipe } from '@ghostfolio/common/pipes'; |
|
|
import { GfSymbolPipe } from '@ghostfolio/common/pipes'; |
|
|
|
|
|
import { internalRoutes } from '@ghostfolio/common/routes/routes'; |
|
|
import { GfActivitiesFilterComponent } from '@ghostfolio/ui/activities-filter'; |
|
|
import { GfActivitiesFilterComponent } from '@ghostfolio/ui/activities-filter'; |
|
|
import { translate } from '@ghostfolio/ui/i18n'; |
|
|
import { translate } from '@ghostfolio/ui/i18n'; |
|
|
import { GfPremiumIndicatorComponent } from '@ghostfolio/ui/premium-indicator'; |
|
|
import { GfPremiumIndicatorComponent } from '@ghostfolio/ui/premium-indicator'; |
|
|
@ -157,6 +158,8 @@ export class GfAdminMarketDataComponent |
|
|
public isUUID = isUUID; |
|
|
public isUUID = isUUID; |
|
|
public placeholder = ''; |
|
|
public placeholder = ''; |
|
|
public pageSize = DEFAULT_PAGE_SIZE; |
|
|
public pageSize = DEFAULT_PAGE_SIZE; |
|
|
|
|
|
public routerLinkAdminControlMarketData = |
|
|
|
|
|
internalRoutes.adminControl.subRoutes.marketData.routerLink; |
|
|
public selection: SelectionModel<Partial<SymbolProfile>>; |
|
|
public selection: SelectionModel<Partial<SymbolProfile>>; |
|
|
public totalItems = 0; |
|
|
public totalItems = 0; |
|
|
public user: User; |
|
|
public user: User; |
|
|
@ -203,22 +206,23 @@ export class GfAdminMarketDataComponent |
|
|
this.displayedColumns.push('comment'); |
|
|
this.displayedColumns.push('comment'); |
|
|
this.displayedColumns.push('actions'); |
|
|
this.displayedColumns.push('actions'); |
|
|
|
|
|
|
|
|
this.route.queryParams |
|
|
if (this.route.snapshot.routeConfig.path === 'market-data/create') { |
|
|
.pipe(takeUntil(this.unsubscribeSubject)) |
|
|
this.openCreateAssetProfileDialog(); |
|
|
.subscribe((params) => { |
|
|
} else { |
|
|
if ( |
|
|
this.route.paramMap |
|
|
params['assetProfileDialog'] && |
|
|
.pipe(takeUntil(this.unsubscribeSubject)) |
|
|
params['dataSource'] && |
|
|
.subscribe((paramMap) => { |
|
|
params['symbol'] |
|
|
const dataSource = paramMap.get('dataSource') as DataSource; |
|
|
) { |
|
|
const symbol = paramMap.get('symbol'); |
|
|
this.openAssetProfileDialog({ |
|
|
|
|
|
dataSource: params['dataSource'], |
|
|
if (dataSource && symbol) { |
|
|
symbol: params['symbol'] |
|
|
this.openAssetProfileDialog({ |
|
|
}); |
|
|
dataSource, |
|
|
} else if (params['createAssetProfileDialog']) { |
|
|
symbol |
|
|
this.openCreateAssetProfileDialog(); |
|
|
}); |
|
|
} |
|
|
} |
|
|
}); |
|
|
}); |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
this.userService.stateChanged |
|
|
this.userService.stateChanged |
|
|
.pipe(takeUntil(this.unsubscribeSubject)) |
|
|
.pipe(takeUntil(this.unsubscribeSubject)) |
|
|
@ -344,15 +348,15 @@ export class GfAdminMarketDataComponent |
|
|
dataSource, |
|
|
dataSource, |
|
|
symbol |
|
|
symbol |
|
|
}: AssetProfileIdentifier) { |
|
|
}: AssetProfileIdentifier) { |
|
|
this.router.navigate([], { |
|
|
this.router.navigate([dataSource, symbol], { |
|
|
queryParams: { |
|
|
relativeTo: this.route |
|
|
dataSource, |
|
|
|
|
|
symbol, |
|
|
|
|
|
assetProfileDialog: true |
|
|
|
|
|
} |
|
|
|
|
|
}); |
|
|
}); |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
public getRouterLinkToAdminControlMarketData(dataSource, symbol) { |
|
|
|
|
|
return [...this.routerLinkAdminControlMarketData, dataSource, symbol]; |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
public ngOnDestroy() { |
|
|
public ngOnDestroy() { |
|
|
this.unsubscribeSubject.next(); |
|
|
this.unsubscribeSubject.next(); |
|
|
this.unsubscribeSubject.complete(); |
|
|
this.unsubscribeSubject.complete(); |
|
|
@ -453,7 +457,9 @@ export class GfAdminMarketDataComponent |
|
|
if (newAssetProfileIdentifier) { |
|
|
if (newAssetProfileIdentifier) { |
|
|
this.onOpenAssetProfileDialog(newAssetProfileIdentifier); |
|
|
this.onOpenAssetProfileDialog(newAssetProfileIdentifier); |
|
|
} else { |
|
|
} else { |
|
|
this.router.navigate(['.'], { relativeTo: this.route }); |
|
|
this.router.navigate( |
|
|
|
|
|
internalRoutes.adminControl.subRoutes.marketData.routerLink |
|
|
|
|
|
); |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
); |
|
|
); |
|
|
@ -484,7 +490,7 @@ export class GfAdminMarketDataComponent |
|
|
.pipe(takeUntil(this.unsubscribeSubject)) |
|
|
.pipe(takeUntil(this.unsubscribeSubject)) |
|
|
.subscribe((result) => { |
|
|
.subscribe((result) => { |
|
|
if (!result) { |
|
|
if (!result) { |
|
|
this.router.navigate(['.'], { relativeTo: this.route }); |
|
|
this.router.navigate(['..'], { relativeTo: this.route }); |
|
|
|
|
|
|
|
|
return; |
|
|
return; |
|
|
} |
|
|
} |
|
|
|