From 653762545ee3f5c761b6ac54c473ee8a76e1e28f Mon Sep 17 00:00:00 2001 From: kevinpauer Date: Tue, 3 May 2022 11:29:55 +0200 Subject: [PATCH] Fix Stock pannel and data --- .../Views/dashboard/dashboard.component.html | 36 +++++++++++-------- .../Views/dashboard/dashboard.component.ts | 27 +++++++------- 2 files changed, 37 insertions(+), 26 deletions(-) diff --git a/frontend/src/app/Views/dashboard/dashboard.component.html b/frontend/src/app/Views/dashboard/dashboard.component.html index 4a43432..f346c34 100644 --- a/frontend/src/app/Views/dashboard/dashboard.component.html +++ b/frontend/src/app/Views/dashboard/dashboard.component.html @@ -12,28 +12,36 @@ The actual rendered columns are set as a property on the row definition" --> - - Symbol - {{ element.symbol }} - - - - + Count {{ element.count }} - - - Time - {{ element.time }} + + + Comment + {{ element.comment }} - - Current Price + + ISIN + {{ element.isin }} + + + + + Price - {{ element.currentPrice }} + {{ element.current_price }} + + + + + + Last Transaction + + {{ element.last_transaction }} diff --git a/frontend/src/app/Views/dashboard/dashboard.component.ts b/frontend/src/app/Views/dashboard/dashboard.component.ts index 6410d1b..6f0ca76 100644 --- a/frontend/src/app/Views/dashboard/dashboard.component.ts +++ b/frontend/src/app/Views/dashboard/dashboard.component.ts @@ -6,9 +6,10 @@ import { HelperService } from 'src/app/Helpers/helper.service'; export interface Stock { count: number; - currentPrice: number; - symbol: string; - time: string; + comment: string; + isin: string; + last_transaction: string; + current_price: number; } var TRANSACTION_DATA: TransactionData[] = []; @@ -65,19 +66,20 @@ export class DashboardComponent implements OnInit { ngOnInit() { this.dataService.getStockData().subscribe((response: any) => { var data = JSON.parse(response); + console.log(data); this.depotCurrentValue = 0; for (let i = 0; i < data.data.length; i++) { this.depotCurrentValue = data.data[i].current_price; STOCK_DATA.push({ count: data.data[i].count, - currentPrice: data.data[i].current_price, - symbol: data.data[i].symbol, - time: data.data[i].last_transaction, + comment: data.data[i].comment, + isin: data.data[i].isin, + last_transaction: data.data[i].last_transaction, + current_price: data.data[i].current_price, }); } + console.log(STOCK_DATA); this.dataSourceStocks = STOCK_DATA; - //TODO move to helper service - this.profit += this.depotCurrentValue; }); @@ -133,9 +135,10 @@ export class DashboardComponent implements OnInit { 'symbol', ]; displayedColumnsStocks: string[] = [ - 'position', - 'name', - 'weight', - 'current-price', + 'count', + 'comment', + 'isin', + 'current_price', + 'last_transaction', ]; }