Browse Source

fix(client): enforce encapsulation

pull/6885/head
KenTandrian 1 week ago
parent
commit
d20b9bbdda
  1. 62
      apps/client/src/app/components/admin-market-data/admin-market-data.component.ts

62
apps/client/src/app/components/admin-market-data/admin-market-data.component.ts

@ -99,11 +99,10 @@ import { CreateAssetProfileDialogParams } from './create-asset-profile-dialog/in
templateUrl: './admin-market-data.html' templateUrl: './admin-market-data.html'
}) })
export class GfAdminMarketDataComponent implements AfterViewInit, OnInit { export class GfAdminMarketDataComponent implements AfterViewInit, OnInit {
@ViewChild(MatPaginator) paginator: MatPaginator; @ViewChild(MatPaginator) private paginator: MatPaginator;
@ViewChild(MatSort) sort: MatSort; @ViewChild(MatSort) private sort: MatSort;
public activeFilters: Filter[] = []; protected allFilters: Filter[] = [
public allFilters: Filter[] = [
...Object.keys(AssetSubClass) ...Object.keys(AssetSubClass)
.filter((assetSubClass) => { .filter((assetSubClass) => {
return assetSubClass !== 'CASH'; return assetSubClass !== 'CASH';
@ -148,27 +147,29 @@ export class GfAdminMarketDataComponent implements AfterViewInit, OnInit {
type: 'PRESET_ID' as Filter['type'] type: 'PRESET_ID' as Filter['type']
} }
]; ];
public benchmarks: Partial<SymbolProfile>[];
public currentDataSource: DataSource; public currentDataSource: DataSource;
public currentSymbol: string; public currentSymbol: string;
public dataSource = new MatTableDataSource<AdminMarketDataItem>(); protected dataSource = new MatTableDataSource<AdminMarketDataItem>();
public defaultDateFormat: string; protected defaultDateFormat: string;
public deviceType: string; protected displayedColumns: string[] = [];
public displayedColumns: string[] = []; protected filters$ = new Subject<Filter[]>();
public filters$ = new Subject<Filter[]>();
public ghostfolioScraperApiSymbolPrefix = ghostfolioScraperApiSymbolPrefix; public ghostfolioScraperApiSymbolPrefix = ghostfolioScraperApiSymbolPrefix;
public hasPermissionForSubscription: boolean; protected isLoading = true;
public info: InfoItem; protected isUUID = isUUID;
public isLoading = true; protected pageSize = DEFAULT_PAGE_SIZE;
public isUUID = isUUID; protected placeholder = '';
public placeholder = ''; protected selection: SelectionModel<AdminMarketDataItem>;
public pageSize = DEFAULT_PAGE_SIZE; protected totalItems = 0;
public selection: SelectionModel<AdminMarketDataItem>; protected user: User;
public totalItems = 0;
public user: User; private activeFilters: Filter[] = [];
private benchmarks: Partial<SymbolProfile>[];
private deviceType: string;
private hasPermissionForSubscription: boolean;
private info: InfoItem;
public constructor( public constructor(
public adminMarketDataService: AdminMarketDataService, protected adminMarketDataService: AdminMarketDataService,
private adminService: AdminService, private adminService: AdminService,
private changeDetectorRef: ChangeDetectorRef, private changeDetectorRef: ChangeDetectorRef,
private dataService: DataService, private dataService: DataService,
@ -279,7 +280,7 @@ export class GfAdminMarketDataComponent implements AfterViewInit, OnInit {
this.selection = new SelectionModel(true); this.selection = new SelectionModel(true);
} }
public onChangePage(page: PageEvent) { protected onChangePage(page: PageEvent) {
this.loadData({ this.loadData({
pageIndex: page.pageIndex, pageIndex: page.pageIndex,
sortColumn: this.sort.active, sortColumn: this.sort.active,
@ -287,11 +288,14 @@ export class GfAdminMarketDataComponent implements AfterViewInit, OnInit {
}); });
} }
public onDeleteAssetProfile({ dataSource, symbol }: AssetProfileIdentifier) { protected onDeleteAssetProfile({
dataSource,
symbol
}: AssetProfileIdentifier) {
this.adminMarketDataService.deleteAssetProfile({ dataSource, symbol }); this.adminMarketDataService.deleteAssetProfile({ dataSource, symbol });
} }
public onDeleteAssetProfiles() { protected onDeleteAssetProfiles() {
this.adminMarketDataService.deleteAssetProfiles( this.adminMarketDataService.deleteAssetProfiles(
this.selection.selected.map(({ dataSource, symbol }) => { this.selection.selected.map(({ dataSource, symbol }) => {
return { dataSource, symbol }; return { dataSource, symbol };
@ -299,7 +303,7 @@ export class GfAdminMarketDataComponent implements AfterViewInit, OnInit {
); );
} }
public onGather7Days() { protected onGather7Days() {
this.adminService this.adminService
.gather7Days() .gather7Days()
.pipe(takeUntilDestroyed(this.destroyRef)) .pipe(takeUntilDestroyed(this.destroyRef))
@ -310,7 +314,7 @@ export class GfAdminMarketDataComponent implements AfterViewInit, OnInit {
}); });
} }
public onGatherMax() { protected onGatherMax() {
this.adminService this.adminService
.gatherMax() .gatherMax()
.pipe(takeUntilDestroyed(this.destroyRef)) .pipe(takeUntilDestroyed(this.destroyRef))
@ -321,14 +325,14 @@ export class GfAdminMarketDataComponent implements AfterViewInit, OnInit {
}); });
} }
public onGatherProfileData() { protected onGatherProfileData() {
this.adminService this.adminService
.gatherProfileData() .gatherProfileData()
.pipe(takeUntilDestroyed(this.destroyRef)) .pipe(takeUntilDestroyed(this.destroyRef))
.subscribe(); .subscribe();
} }
public onGatherProfileDataBySymbol({ protected onGatherProfileDataBySymbol({
dataSource, dataSource,
symbol symbol
}: AssetProfileIdentifier) { }: AssetProfileIdentifier) {
@ -338,14 +342,14 @@ export class GfAdminMarketDataComponent implements AfterViewInit, OnInit {
.subscribe(); .subscribe();
} }
public onGatherSymbol({ dataSource, symbol }: AssetProfileIdentifier) { protected onGatherSymbol({ dataSource, symbol }: AssetProfileIdentifier) {
this.adminService this.adminService
.gatherSymbol({ dataSource, symbol }) .gatherSymbol({ dataSource, symbol })
.pipe(takeUntilDestroyed(this.destroyRef)) .pipe(takeUntilDestroyed(this.destroyRef))
.subscribe(); .subscribe();
} }
public onOpenAssetProfileDialog({ protected onOpenAssetProfileDialog({
dataSource, dataSource,
symbol symbol
}: AssetProfileIdentifier) { }: AssetProfileIdentifier) {

Loading…
Cancel
Save