Browse Source

Improve the impersonation mode in positions

pull/293/head
Thomas 4 years ago
parent
commit
8d7ebeaf7b
  1. 10
      apps/api/src/app/portfolio/portfolio.controller.ts
  2. 16
      apps/client/src/app/components/value/value.component.html

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

@ -213,6 +213,16 @@ export class PortfolioController {
res.status(StatusCodes.ACCEPTED);
}
if (impersonationId) {
result.positions = result.positions.map((position) => {
return nullifyValuesInObject(position, [
'grossPerformance',
'investment',
'quantity'
]);
});
}
return <any>res.json(result);
}

16
apps/client/src/app/components/value/value.component.html

@ -1,16 +1,21 @@
<ng-container *ngIf="value || value === 0">
<ng-container *ngIf="value || value === 0 || value === null">
<div
class="d-flex"
[ngClass]="position === 'end' ? 'justify-content-end' : ''"
>
<ng-container *ngIf="isNumber">
<ng-container *ngIf="isNumber || value === null">
<div *ngIf="colorizeSign && value > 0" class="mr-1 text-success">+</div>
<div *ngIf="colorizeSign && value < 0" class="mr-1 text-danger">-</div>
<div *ngIf="isPercent" [ngClass]="size === 'medium' ? 'h4 mb-0' : ''">
{{ formattedValue }}%
</div>
<div *ngIf="!isPercent" [ngClass]="size === 'medium' ? 'h4 mb-0' : ''">
{{ formattedValue }}
<ng-container *ngIf="value === null">
<span class="text-monospace text-muted">***</span>
</ng-container>
<ng-container *ngIf="value !== null">
{{ formattedValue }}
</ng-container>
</div>
<small *ngIf="currency && size === 'medium'" class="ml-1">
{{ currency }}
@ -38,8 +43,3 @@
width: '5rem'
}"
></ngx-skeleton-loader>
<div *ngIf="value === null">
<span class="text-monospace text-muted text-right">***</span>
<span *ngIf="currency" class="ml-1 text-muted">{{ currency }}</span>
</div>

Loading…
Cancel
Save