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 | 65 ++++++++++--------- .../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, 46 insertions(+), 37 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index eaca8f744..dfba98d14 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 e61ab79ee..ee11e4d1b 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 10d492f50..b7f9248b4 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 524e54c07..3d9ac93e9 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,49 +26,45 @@ - + - Value + Name - -
- -
+ + {{ + element.name + }}
- + - Performance + Value
- + - Initial Allocation + Allocation - -
+ +
- + - Current Allocation + Performance - +
- + ; };