From f7bf6e652bac3a33861794112c55ac1cbd3ae23c Mon Sep 17 00:00:00 2001 From: Thomas Kaul <4159106+dtslvr@users.noreply.github.com> Date: Sat, 25 Jun 2022 11:33:59 +0200 Subject: [PATCH] Feature/add icon and name to positions table (#1040) * Add icon and name * Update changelog --- CHANGELOG.md | 4 + .../src/app/portfolio/portfolio.controller.ts | 1 + .../src/app/portfolio/portfolio.service.ts | 1 + .../positions-table.component.html | 95 ++++++++++--------- .../positions-table.component.ts | 9 +- .../positions-table/positions-table.module.ts | 1 - .../enhanced-symbol-profile.interface.ts | 1 + .../portfolio-public-details.interface.ts | 1 + 8 files changed, 61 insertions(+), 52 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index eaca8f74..dfba98d1 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -7,6 +7,10 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ## Unreleased +### Added + +- Added an icon and name column to the positions table + ### Changed - Changed the data gathering by symbol endpoint to delete data first diff --git a/apps/api/src/app/portfolio/portfolio.controller.ts b/apps/api/src/app/portfolio/portfolio.controller.ts index e61ab79e..ee11e4d1 100644 --- a/apps/api/src/app/portfolio/portfolio.controller.ts +++ b/apps/api/src/app/portfolio/portfolio.controller.ts @@ -346,6 +346,7 @@ export class PortfolioController { netPerformancePercent: portfolioPosition.netPerformancePercent, sectors: hasDetails ? portfolioPosition.sectors : [], symbol: portfolioPosition.symbol, + url: portfolioPosition.url, value: portfolioPosition.value / totalValue }; } diff --git a/apps/api/src/app/portfolio/portfolio.service.ts b/apps/api/src/app/portfolio/portfolio.service.ts index 10d492f5..b7f9248b 100644 --- a/apps/api/src/app/portfolio/portfolio.service.ts +++ b/apps/api/src/app/portfolio/portfolio.service.ts @@ -441,6 +441,7 @@ export class PortfolioService { sectors: symbolProfile.sectors, symbol: item.symbol, transactionCount: item.transactionCount, + url: symbolProfile.url, value: value.toNumber() }; } diff --git a/apps/client/src/app/components/positions-table/positions-table.component.html b/apps/client/src/app/components/positions-table/positions-table.component.html index 524e54c0..3d9ac93e 100644 --- a/apps/client/src/app/components/positions-table/positions-table.component.html +++ b/apps/client/src/app/components/positions-table/positions-table.component.html @@ -6,6 +6,17 @@ mat-table [dataSource]="dataSource" > + + + + + + + Symbol @@ -15,6 +26,23 @@ + + + Name + + + {{ + element.name + }} + + + - - - Performance - - -
- -
- -
- - - - Initial Allocation - - -
- -
- -
- - Current Allocation + Allocation
@@ -99,7 +85,28 @@ - + + + Performance + + +
+ +
+ +
+ + ; };