Feature/add investment streaks (#2042)

* Add investment streaks

* Current streak
* Longest streak

* Add unit to value component

* Update changelog
This commit is contained in:
Thomas Kaul
2023-06-04 09:35:58 +02:00
committed by GitHub
parent 51e8555fa5
commit d630fb900d
18 changed files with 962 additions and 460 deletions

View File

@@ -2,4 +2,5 @@ import { InvestmentItem } from './investment-item.interface';
export interface PortfolioInvestments {
investments: InvestmentItem[];
streaks: { currentStreak: number; longestStreak: number };
}

View File

@@ -13,12 +13,16 @@ const locales = {
HIGHER_RISK: $localize`Higher Risk`,
IMPORT_ACTIVITY_ERROR_IS_DUPLICATE: $localize`This activity already exists.`,
LOWER_RISK: $localize`Lower Risk`,
MONTH: $localize`Month`,
MONTHS: $localize`Months`,
OTHER: $localize`Other`,
RETIREMENT_PROVISION: $localize`Retirement Provision`,
SATELLITE: $localize`Satellite`,
SECURITIES: $localize`Securities`,
SYMBOL: $localize`Symbol`,
TAG: $localize`Tag`,
YEAR: $localize`Year`,
YEARS: $localize`Years`,
// enum AssetClass
CASH: $localize`Cash`,

View File

@@ -35,9 +35,15 @@
<small *ngIf="currency && size === 'medium'" class="ml-1">
{{ currency }}
</small>
<small *ngIf="unit && size === 'medium'" class="ml-1">
{{ unit }}
</small>
<div *ngIf="currency && size !== 'medium'" class="ml-1">
{{ currency }}
</div>
<div *ngIf="unit && size !== 'medium'" class="ml-1">
{{ unit }}
</div>
</ng-container>
<ng-container *ngIf="isString">
<div

View File

@@ -26,6 +26,7 @@ export class ValueComponent implements OnChanges {
@Input() precision: number | undefined;
@Input() size: 'large' | 'medium' | 'small' = 'small';
@Input() subLabel = '';
@Input() unit = '';
@Input() value: number | string = '';
public absoluteValue = 0;