Browse Source
Feature/add guards to local comparison (#986)
* Add guards
* Improve labels
pull/988/head
Thomas Kaul
3 years ago
committed by
GitHub
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with
6 additions and
6 deletions
-
apps/api/src/app/portfolio/portfolio-calculator.ts
-
libs/ui/src/lib/activities-filter/activities-filter.component.ts
-
libs/ui/src/lib/activities-table/activities-table.component.html
|
|
@ -56,7 +56,7 @@ export class PortfolioCalculator { |
|
|
|
this.currentRateService = currentRateService; |
|
|
|
this.orders = orders; |
|
|
|
|
|
|
|
this.orders.sort((a, b) => a.date.localeCompare(b.date)); |
|
|
|
this.orders.sort((a, b) => a.date?.localeCompare(b.date)); |
|
|
|
} |
|
|
|
|
|
|
|
public computeTransactionPoints() { |
|
|
@ -125,7 +125,7 @@ export class PortfolioCalculator { |
|
|
|
(transactionPointItem) => transactionPointItem.symbol !== order.symbol |
|
|
|
); |
|
|
|
newItems.push(currentTransactionPointItem); |
|
|
|
newItems.sort((a, b) => a.symbol.localeCompare(b.symbol)); |
|
|
|
newItems.sort((a, b) => a.symbol?.localeCompare(b.symbol)); |
|
|
|
if (lastDate !== currentDate || lastTransactionPoint === null) { |
|
|
|
lastTransactionPoint = { |
|
|
|
date: currentDate, |
|
|
|
|
|
@ -126,7 +126,7 @@ export class ActivitiesFilterComponent implements OnChanges, OnDestroy { |
|
|
|
|
|
|
|
return filter; |
|
|
|
}) |
|
|
|
.sort((a, b) => a.label.localeCompare(b.label)), |
|
|
|
.sort((a, b) => a.label?.localeCompare(b.label)), |
|
|
|
(filter) => { |
|
|
|
return filter.type; |
|
|
|
} |
|
|
@ -142,7 +142,7 @@ export class ActivitiesFilterComponent implements OnChanges, OnDestroy { |
|
|
|
} |
|
|
|
|
|
|
|
return filterGroups |
|
|
|
.sort((a, b) => a.name.localeCompare(b.name)) |
|
|
|
.sort((a, b) => a.name?.localeCompare(b.name)) |
|
|
|
.map((filterGroup) => { |
|
|
|
return { |
|
|
|
...filterGroup, |
|
|
|
|
|
@ -322,7 +322,7 @@ |
|
|
|
(click)="onImport()" |
|
|
|
> |
|
|
|
<ion-icon class="mr-2" name="cloud-upload-outline"></ion-icon> |
|
|
|
<span i18n>Import</span> |
|
|
|
<span i18n>Import Activities</span> |
|
|
|
</button> |
|
|
|
<button |
|
|
|
*ngIf="hasPermissionToExportActivities" |
|
|
@ -332,7 +332,7 @@ |
|
|
|
(click)="onExport()" |
|
|
|
> |
|
|
|
<ion-icon class="mr-2" name="cloud-download-outline"></ion-icon> |
|
|
|
<span i18n>Export</span> |
|
|
|
<span i18n>Export Activities</span> |
|
|
|
</button> |
|
|
|
<button |
|
|
|
*ngIf="hasPermissionToExportActivities" |
|
|
|