Browse Source

Refactoring

pull/5762/head
Thomas Kaul 2 weeks ago
parent
commit
f8de5cde49
  1. 2
      apps/client/src/app/components/admin-market-data/admin-market-data.component.ts
  2. 12
      apps/client/src/app/components/admin-market-data/asset-profile-dialog/asset-profile-dialog.component.ts
  3. 1
      apps/client/src/app/components/admin-market-data/create-asset-profile-dialog/create-asset-profile-dialog.component.ts
  4. 5
      apps/client/src/app/services/admin.service.ts

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

@ -336,7 +336,7 @@ export class GfAdminMarketDataComponent
public onGatherSymbol({ dataSource, symbol }: AssetProfileIdentifier) { public onGatherSymbol({ dataSource, symbol }: AssetProfileIdentifier) {
this.adminService this.adminService
.gatherSymbol({ range: undefined, dataSource, symbol }) .gatherSymbol({ dataSource, symbol })
.pipe(takeUntil(this.unsubscribeSubject)) .pipe(takeUntil(this.unsubscribeSubject))
.subscribe(); .subscribe();
} }

12
apps/client/src/app/components/admin-market-data/asset-profile-dialog/asset-profile-dialog.component.ts

@ -204,12 +204,18 @@ export class GfAssetProfileDialogComponent implements OnDestroy, OnInit {
label: $localize`Current year` + ' (' + $localize`YTD` + ')', label: $localize`Current year` + ' (' + $localize`YTD` + ')',
value: 'ytd' value: 'ytd'
}, },
{ label: '1 ' + $localize`year` + ' (' + $localize`1Y` + ')', value: '1y' }, {
label: '1 ' + $localize`year` + ' (' + $localize`1Y` + ')',
value: '1y'
},
{ {
label: '5 ' + $localize`years` + ' (' + $localize`5Y` + ')', label: '5 ' + $localize`years` + ' (' + $localize`5Y` + ')',
value: '5y' value: '5y'
}, },
{ label: $localize`Max`, value: 'max' } {
label: $localize`Max`,
value: 'max'
}
]; ];
public historicalDataItems: LineChartItem[]; public historicalDataItems: LineChartItem[];
public isBenchmark = false; public isBenchmark = false;
@ -431,7 +437,7 @@ export class GfAssetProfileDialogComponent implements OnDestroy, OnInit {
range, range,
symbol symbol
}: { }: {
range: DateRange; range?: DateRange;
} & AssetProfileIdentifier) { } & AssetProfileIdentifier) {
this.adminService this.adminService
.gatherSymbol({ dataSource, range, symbol }) .gatherSymbol({ dataSource, range, symbol })

1
apps/client/src/app/components/admin-market-data/create-asset-profile-dialog/create-asset-profile-dialog.component.ts

@ -122,7 +122,6 @@ export class GfCreateAssetProfileDialogComponent implements OnInit, OnDestroy {
.pipe( .pipe(
switchMap(() => { switchMap(() => {
return this.adminService.gatherSymbol({ return this.adminService.gatherSymbol({
range: undefined,
dataSource: this.dataSourceForExchangeRates, dataSource: this.dataSourceForExchangeRates,
symbol: `${DEFAULT_CURRENCY}${currency}` symbol: `${DEFAULT_CURRENCY}${currency}`
}); });

5
apps/client/src/app/services/admin.service.ts

@ -184,7 +184,7 @@ export class AdminService {
range, range,
symbol symbol
}: { }: {
range: DateRange; range?: DateRange;
} & AssetProfileIdentifier) { } & AssetProfileIdentifier) {
let params = new HttpParams(); let params = new HttpParams();
@ -193,7 +193,8 @@ export class AdminService {
} }
const url = `/api/v1/admin/gather/${dataSource}/${symbol}`; const url = `/api/v1/admin/gather/${dataSource}/${symbol}`;
return this.http.post<MarketData | void>(url, null, { params });
return this.http.post<MarketData | void>(url, undefined, { params });
} }
public fetchSymbolForDate({ public fetchSymbolForDate({

Loading…
Cancel
Save