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. 14
      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); res.status(StatusCodes.ACCEPTED);
} }
if (impersonationId) {
result.positions = result.positions.map((position) => {
return nullifyValuesInObject(position, [
'grossPerformance',
'investment',
'quantity'
]);
});
}
return <any>res.json(result); return <any>res.json(result);
} }

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