Browse Source

Move break down of performance to general availability

pull/3047/head
Thomas Kaul 2 years ago
parent
commit
410e802edd
  1. 4
      apps/api/src/app/portfolio/portfolio.controller.ts
  2. 255
      apps/client/src/app/pages/portfolio/analysis/analysis-page.html
  3. 13
      libs/ui/src/lib/value/value.component.html

4
apps/api/src/app/portfolio/portfolio.controller.ts

@ -425,6 +425,10 @@ export class PortfolioController {
return nullifyValuesInObject(item, ['totalInvestment', 'value']); return nullifyValuesInObject(item, ['totalInvestment', 'value']);
} }
); );
performanceInformation.performance = nullifyValuesInObject(
performanceInformation.performance,
['currentNetPerformance', 'currentNetPerformancePercent']
);
} }
return performanceInformation; return performanceInformation;

255
apps/client/src/app/pages/portfolio/analysis/analysis-page.html

@ -18,136 +18,149 @@
</div> </div>
</div> </div>
@if (user?.settings?.isExperimentalFeatures) { <div class="mb-5 row">
<div class="mb-5 row"> <div class="col">
<div class="col"> <mat-card appearance="outlined" class="mb-3">
<mat-card appearance="outlined" class="mb-3"> <mat-card-content>
<mat-card-content> <div class="d-flex py-1">
<div class="d-flex py-1"> <div
<div class="flex-grow-1 mr-2 text-truncate" i18n> class="align-items-center d-flex flex-grow-1 mr-2 text-truncate"
Absolute Asset Performance i18n
</div> >
<div class="d-flex justify-content-end"> <span>Absolute Asset Performance</span>
<gf-value <gf-premium-indicator
class="justify-content-end" *ngIf="user?.subscription?.type === 'Basic'"
position="end" class="ml-1"
[isCurrency]="true" />
[locale]="user?.settings?.locale" </div>
[unit]="user?.settings?.baseCurrency" <div class="d-flex justify-content-end">
[value]=" <gf-value
isLoadingInvestmentChart class="justify-content-end"
? undefined position="end"
: performance?.currentNetPerformance [isCurrency]="true"
" [locale]="user?.settings?.locale"
/> [unit]="user?.settings?.baseCurrency"
</div> [value]="
isLoadingInvestmentChart
? undefined
: performance?.currentNetPerformance
"
/>
</div>
</div>
<div class="d-flex mb-3 ml-3 py-1">
<div class="flex-grow-1 mr-2 text-truncate" i18n>
Asset Performance
</div>
<div class="d-flex justify-content-end">
<gf-value
class="justify-content-end"
position="end"
[colorizeSign]="true"
[isPercent]="true"
[locale]="user?.settings?.locale"
[value]="
isLoadingInvestmentChart
? undefined
: performance?.currentNetPerformancePercent
"
/>
</div> </div>
<div class="d-flex mb-3 ml-3 py-1"> </div>
<div class="flex-grow-1 mr-2 text-truncate" i18n> <div class="d-flex py-1">
Asset Performance <div
</div> class="align-items-center d-flex flex-grow-1 mr-2 text-truncate"
<div class="d-flex justify-content-end"> i18n
<gf-value >
class="justify-content-end" <span>Absolute Currency Performance</span>
position="end" <gf-premium-indicator
[colorizeSign]="true" *ngIf="user?.subscription?.type === 'Basic'"
[isPercent]="true" class="ml-1"
[locale]="user?.settings?.locale" />
[value]="
isLoadingInvestmentChart
? undefined
: performance?.currentNetPerformancePercent
"
/>
</div>
</div> </div>
<div class="d-flex py-1"> <div class="d-flex justify-content-end">
<div class="flex-grow-1 mr-2 text-truncate" i18n> <gf-value
Absolute Currency Performance class="justify-content-end"
</div> position="end"
<div class="d-flex justify-content-end"> [isCurrency]="true"
<gf-value [locale]="user?.settings?.locale"
class="justify-content-end" [unit]="user?.settings?.baseCurrency"
position="end" [value]="
[isCurrency]="true" isLoadingInvestmentChart
[locale]="user?.settings?.locale" ? undefined
[unit]="user?.settings?.baseCurrency" : performance?.currentNetPerformance === null
[value]=" ? null
isLoadingInvestmentChart : performance?.currentNetPerformanceWithCurrencyEffect -
? undefined performance?.currentNetPerformance
: performance?.currentNetPerformanceWithCurrencyEffect === "
null />
? null </div>
: performance?.currentNetPerformanceWithCurrencyEffect - </div>
performance?.currentNetPerformance <div class="d-flex ml-3 py-1">
" <div class="flex-grow-1 mr-2 text-truncate" i18n>
/> Currency Performance
</div>
</div> </div>
<div class="d-flex ml-3 py-1"> <div class="d-flex justify-content-end">
<div class="flex-grow-1 mr-2 text-truncate" i18n> <gf-value
Currency Performance class="justify-content-end"
</div> position="end"
<div class="d-flex justify-content-end"> [colorizeSign]="true"
<gf-value [isPercent]="true"
class="justify-content-end" [locale]="user?.settings?.locale"
position="end" [value]="
[colorizeSign]="true" isLoadingInvestmentChart
[isPercent]="true" ? undefined
[locale]="user?.settings?.locale" : performance?.currentNetPerformancePercent === null
[value]=" ? null
isLoadingInvestmentChart
? undefined
: performance?.currentNetPerformancePercentWithCurrencyEffect - : performance?.currentNetPerformancePercentWithCurrencyEffect -
performance?.currentNetPerformancePercent performance?.currentNetPerformancePercent
" "
/> />
</div>
</div> </div>
<div><hr /></div> </div>
<div class="d-flex py-1"> <div><hr /></div>
<div class="flex-grow-1 mr-2 text-truncate" i18n> <div class="d-flex py-1">
Absolute Net Performance <div class="flex-grow-1 mr-2 text-truncate" i18n>
</div> Absolute Net Performance
<div class="d-flex justify-content-end">
<gf-value
class="justify-content-end"
position="end"
[isCurrency]="true"
[locale]="user?.settings?.locale"
[unit]="user?.settings?.baseCurrency"
[value]="
isLoadingInvestmentChart
? undefined
: performance?.currentNetPerformanceWithCurrencyEffect
"
/>
</div>
</div> </div>
<div class="d-flex ml-3 py-1"> <div class="d-flex justify-content-end">
<div class="flex-grow-1 mr-2 text-truncate" i18n> <gf-value
Net Performance class="justify-content-end"
</div> position="end"
<div class="d-flex justify-content-end"> [isCurrency]="true"
<gf-value [locale]="user?.settings?.locale"
class="justify-content-end" [unit]="user?.settings?.baseCurrency"
position="end" [value]="
[colorizeSign]="true" isLoadingInvestmentChart
[isPercent]="true" ? undefined
[locale]="user?.settings?.locale" : performance?.currentNetPerformanceWithCurrencyEffect
[value]=" "
isLoadingInvestmentChart />
? undefined
: performance?.currentNetPerformancePercentWithCurrencyEffect
"
/>
</div>
</div> </div>
</mat-card-content> </div>
</mat-card> <div class="d-flex ml-3 py-1">
</div> <div class="flex-grow-1 mr-2 text-truncate" i18n>
Net Performance
</div>
<div class="d-flex justify-content-end">
<gf-value
class="justify-content-end"
position="end"
[colorizeSign]="true"
[isPercent]="true"
[locale]="user?.settings?.locale"
[value]="
isLoadingInvestmentChart
? undefined
: performance?.currentNetPerformancePercentWithCurrencyEffect
"
/>
</div>
</div>
</mat-card-content>
</mat-card>
</div> </div>
} </div>
<div class="mb-5 row"> <div class="mb-5 row">
<div class="col-md-6"> <div class="col-md-6">

13
libs/ui/src/lib/value/value.component.html

@ -21,7 +21,11 @@
h4: size === 'medium' h4: size === 'medium'
}" }"
> >
{{ formattedValue }}% @if (value === null) {
<span class="text-monospace text-muted">*****</span>%
} @else {
{{ formattedValue }}%
}
</div> </div>
<div <div
*ngIf="!isPercent" *ngIf="!isPercent"
@ -31,12 +35,11 @@
h4: size === 'medium' h4: size === 'medium'
}" }"
> >
<ng-container *ngIf="value === null"> @if (value === null) {
<span class="text-monospace text-muted">*****</span> <span class="text-monospace text-muted">*****</span>
</ng-container> } @else {
<ng-container *ngIf="value !== null">
{{ formattedValue }} {{ formattedValue }}
</ng-container> }
</div> </div>
<small *ngIf="unit && size === 'medium'" class="ml-1"> <small *ngIf="unit && size === 'medium'" class="ml-1">
{{ unit }} {{ unit }}

Loading…
Cancel
Save