From 01feead0175c08efd5d4cbd8aa7481deba6b516e Mon Sep 17 00:00:00 2001 From: Ivo Valchev Date: Thu, 2 Sep 2021 20:47:27 +0200 Subject: [PATCH 1/2] Show decimal `transactionCount` and singular for 1 transaction (#327) * Show decimal `transactionCount` and singular for 1 transaction * Update changelog Co-authored-by: Thomas <4159106+dtslvr@users.noreply.github.com> --- CHANGELOG.md | 6 ++++++ .../position-detail-dialog/position-detail-dialog.html | 5 +++-- apps/client/src/app/components/value/value.component.ts | 8 ++++++++ 3 files changed, 17 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index b8dfcd8a7..e466f511c 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,6 +5,12 @@ All notable changes to this project will be documented in this file. The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). +### Unreleased + +### Fixed + +- Fixed the value formatting for integers (transactions count) + ## 1.44.0 - 30.08.2021 ### Changed diff --git a/apps/client/src/app/components/position/position-detail-dialog/position-detail-dialog.html b/apps/client/src/app/components/position/position-detail-dialog/position-detail-dialog.html index 870ec1fbe..26e6aa43e 100644 --- a/apps/client/src/app/components/position/position-detail-dialog/position-detail-dialog.html +++ b/apps/client/src/app/components/position/position-detail-dialog/position-detail-dialog.html @@ -102,9 +102,10 @@
diff --git a/apps/client/src/app/components/value/value.component.ts b/apps/client/src/app/components/value/value.component.ts index b4b619c5d..1452bef59 100644 --- a/apps/client/src/app/components/value/value.component.ts +++ b/apps/client/src/app/components/value/value.component.ts @@ -19,6 +19,7 @@ export class ValueComponent implements OnChanges, OnInit { @Input() colorizeSign: boolean; @Input() currency: string; @Input() isCurrency: boolean; + @Input() isInteger: boolean; @Input() isPercent: boolean; @Input() label: string; @Input() locale: string; @@ -84,6 +85,13 @@ export class ValueComponent implements OnChanges, OnInit { minimumFractionDigits: 2 }); } catch {} + } else if (this.isInteger) { + try { + this.formattedValue = this.value?.toLocaleString(this.locale, { + maximumFractionDigits: 0, + minimumFractionDigits: 0 + }); + } catch {} } } else { try { From ba9e6eab5867cb0ff8a29dcfb064e37b300bdf03 Mon Sep 17 00:00:00 2001 From: Thomas Kaul <4159106+dtslvr@users.noreply.github.com> Date: Thu, 2 Sep 2021 21:17:01 +0200 Subject: [PATCH 2/2] Feature/add link to transactions below holdings (#329) * Add link: Manage transactions * Update changelog --- CHANGELOG.md | 4 +++ .../src/app/pages/home/home-page.component.ts | 8 +++++ apps/client/src/app/pages/home/home-page.html | 34 ++++++++++++------- .../src/app/pages/zen/zen-page.component.ts | 9 +++++ apps/client/src/app/pages/zen/zen-page.html | 33 ++++++++++++------ 5 files changed, 65 insertions(+), 23 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index e466f511c..661754e4b 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 a link below the holdings to manage the transactions + ### Fixed - Fixed the value formatting for integers (transactions count) diff --git a/apps/client/src/app/pages/home/home-page.component.ts b/apps/client/src/app/pages/home/home-page.component.ts index 7da83c066..aaad1e32f 100644 --- a/apps/client/src/app/pages/home/home-page.component.ts +++ b/apps/client/src/app/pages/home/home-page.component.ts @@ -58,6 +58,7 @@ export class HomePageComponent implements OnDestroy, OnInit { public fearAndGreedIndex: number; public hasImpersonationId: boolean; public hasPermissionToAccessFearAndGreedIndex: boolean; + public hasPermissionToCreateOrder: boolean; public hasPositions: boolean; public historicalDataItems: LineChartItem[]; public isLoadingPerformance = true; @@ -119,6 +120,11 @@ export class HomePageComponent implements OnDestroy, OnInit { }); } + this.hasPermissionToCreateOrder = hasPermission( + this.user.permissions, + permissions.createOrder + ); + this.changeDetectorRef.markForCheck(); } }); @@ -135,6 +141,8 @@ export class HomePageComponent implements OnDestroy, OnInit { .pipe(takeUntil(this.unsubscribeSubject)) .subscribe((aId) => { this.hasImpersonationId = !!aId; + + this.changeDetectorRef.markForCheck(); }); this.dateRange = diff --git a/apps/client/src/app/pages/home/home-page.html b/apps/client/src/app/pages/home/home-page.html index dd6d73aad..d172d3f06 100644 --- a/apps/client/src/app/pages/home/home-page.html +++ b/apps/client/src/app/pages/home/home-page.html @@ -91,18 +91,28 @@ (change)="onChangeDateRange($event.value)" >
- - - - - - + + + + + + + +
{ this.hasImpersonationId = !!aId; + + this.changeDetectorRef.markForCheck(); }); this.update(); diff --git a/apps/client/src/app/pages/zen/zen-page.html b/apps/client/src/app/pages/zen/zen-page.html index f64a861b3..ebd47b1ce 100644 --- a/apps/client/src/app/pages/zen/zen-page.html +++ b/apps/client/src/app/pages/zen/zen-page.html @@ -64,17 +64,28 @@

Holdings

- - - - - + + + + + + + +