Browse Source

Merge branch 'main' into feature/refactor-value-redaction-interceptor

pull/1624/head
Thomas Kaul 3 years ago
committed by GitHub
parent
commit
a266ad63fa
No known key found for this signature in database GPG Key ID: 4AEE18F83AFDEB23
  1. 5
      CHANGELOG.md
  2. 2
      apps/api/src/app/portfolio/portfolio-calculator.ts
  3. 52
      apps/api/src/app/portfolio/portfolio.service.ts
  4. 9
      apps/client/src/app/components/home-overview/home-overview.component.ts
  5. 1
      apps/client/src/app/components/home-overview/home-overview.html
  6. 4
      apps/client/src/app/components/portfolio-performance/portfolio-performance.component.html
  7. 1
      apps/client/src/app/components/portfolio-performance/portfolio-performance.component.ts
  8. 20
      apps/client/src/app/pages/landing/landing-page.html
  9. 5
      apps/client/src/app/pages/landing/landing-page.scss
  10. BIN
      apps/client/src/assets/images/logo-sackgeld.png

5
CHANGELOG.md

@ -7,9 +7,14 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
## Unreleased
### Added
- Added _Sackgeld.com_ to the _As seen in_ section on the landing page
### Changed
- Removed the toggle _Original Shares_ vs. _Current Shares_ on the allocations page
- Hid error messages related to no current investment in the client
- Refactored the value redaction interceptor for the impersonation mode
### Fixed

2
apps/api/src/app/portfolio/portfolio-calculator.ts

@ -447,7 +447,7 @@ export class PortfolioCalculator {
transactionCount: item.transactionCount
});
if (hasErrors) {
if (hasErrors && item.investment.gt(0)) {
errors.push({ dataSource: item.dataSource, symbol: item.symbol });
}
}

52
apps/api/src/app/portfolio/portfolio.service.ts

@ -1039,29 +1039,21 @@ export class PortfolioService {
const portfolioStart = parseDate(transactionPoints[0].date);
const startDate = this.getStartDate(dateRange, portfolioStart);
const currentPositions = await portfolioCalculator.getCurrentPositions(
startDate
);
const {
currentValue,
errors,
grossPerformance,
grossPerformancePercentage,
hasErrors,
netPerformance,
netPerformancePercentage,
totalInvestment
} = await portfolioCalculator.getCurrentPositions(startDate);
const hasErrors = currentPositions.hasErrors;
const currentValue = currentPositions.currentValue.toNumber();
const currentGrossPerformance = currentPositions.grossPerformance;
const currentGrossPerformancePercent =
currentPositions.grossPerformancePercentage;
let currentNetPerformance = currentPositions.netPerformance;
let currentNetPerformancePercent =
currentPositions.netPerformancePercentage;
const totalInvestment = currentPositions.totalInvestment;
// if (currentGrossPerformance.mul(currentGrossPerformancePercent).lt(0)) {
// // If algebraic sign is different, harmonize it
// currentGrossPerformancePercent = currentGrossPerformancePercent.mul(-1);
// }
// if (currentNetPerformance.mul(currentNetPerformancePercent).lt(0)) {
// // If algebraic sign is different, harmonize it
// currentNetPerformancePercent = currentNetPerformancePercent.mul(-1);
// }
const currentGrossPerformance = grossPerformance;
const currentGrossPerformancePercent = grossPerformancePercentage;
let currentNetPerformance = netPerformance;
let currentNetPerformancePercent = netPerformancePercentage;
const historicalDataContainer = await this.getChart({
dateRange,
@ -1083,28 +1075,28 @@ export class PortfolioService {
}
return {
errors,
hasErrors,
chart: historicalDataContainer.items.map(
({
date,
netPerformance,
netPerformance: netPerformanceOfItem,
netPerformanceInPercentage,
totalInvestment,
totalInvestment: totalInvestmentOfItem,
value
}) => {
return {
date,
netPerformance,
netPerformanceInPercentage,
totalInvestment,
value
value,
netPerformance: netPerformanceOfItem,
totalInvestment: totalInvestmentOfItem
};
}
),
errors: currentPositions.errors,
firstOrderDate: parseDate(historicalDataContainer.items[0]?.date),
hasErrors: currentPositions.hasErrors || hasErrors,
performance: {
currentValue,
currentValue: currentValue.toNumber(),
currentGrossPerformance: currentGrossPerformance.toNumber(),
currentGrossPerformancePercent:
currentGrossPerformancePercent.toNumber(),

9
apps/client/src/app/components/home-overview/home-overview.component.ts

@ -110,13 +110,12 @@ export class HomeOverviewComponent implements OnDestroy, OnInit {
range: this.user?.settings?.dateRange
})
.pipe(takeUntil(this.unsubscribeSubject))
.subscribe((response) => {
this.errors = response.errors;
this.hasError = response.hasErrors;
this.performance = response.performance;
.subscribe(({ chart, errors, performance }) => {
this.errors = errors;
this.performance = performance;
this.isLoadingPerformance = false;
this.historicalDataItems = response.chart.map(
this.historicalDataItems = chart.map(
({ date, netPerformanceInPercentage }) => {
return {
date,

1
apps/client/src/app/components/home-overview/home-overview.html

@ -37,7 +37,6 @@
[baseCurrency]="user?.settings?.baseCurrency"
[deviceType]="deviceType"
[errors]="errors"
[hasError]="hasError"
[isAllTimeHigh]="isAllTimeHigh"
[isAllTimeLow]="isAllTimeLow"
[isLoading]="isLoadingPerformance"

4
apps/client/src/app/components/portfolio-performance/portfolio-performance.component.html

@ -3,14 +3,14 @@
<div
class="flex-grow-1 status text-muted text-right"
[title]="
hasError && !isLoading
errors?.length > 0 && !isLoading
? 'Sorry! Our data provider partner is experiencing the hiccups.'
: ''
"
(click)="errors?.length > 0 && onShowErrors()"
>
<ion-icon
*ngIf="hasError && !isLoading"
*ngIf="errors?.length > 0 && !isLoading"
name="alert-circle-outline"
></ion-icon>
</div>

1
apps/client/src/app/components/portfolio-performance/portfolio-performance.component.ts

@ -28,7 +28,6 @@ export class PortfolioPerformanceComponent implements OnChanges, OnInit {
@Input() baseCurrency: string;
@Input() deviceType: string;
@Input() errors: ResponseError['errors'];
@Input() hasError: boolean;
@Input() isAllTimeHigh: boolean;
@Input() isAllTimeLow: boolean;
@Input() isLoading: boolean;

20
apps/client/src/app/pages/landing/landing-page.html

@ -106,7 +106,7 @@
<div class="row mb-5">
<div class="col-12 text-center text-muted"><small>As seen in</small></div>
<div class="col-md-2 d-flex justify-content-center my-1">
<div class="col-md-3 d-flex justify-content-center my-1">
<a
class="d-block logo logo-alternative-to mask"
href="https://alternativeto.net"
@ -114,7 +114,7 @@
title="AlternativeTo - Crowdsourced software recommendations"
></a>
</div>
<div class="col-md-2 d-flex justify-content-center my-1">
<div class="col-md-3 d-flex justify-content-center my-1">
<a
class="d-block logo logo-awesome"
href="https://github.com/awesome-selfhosted/awesome-selfhosted"
@ -122,7 +122,7 @@
title="Awesome-Selfhosted: A list of Free Software network services and web applications which can be hosted on your own servers"
></a>
</div>
<div class="col-md-2 d-flex justify-content-center my-1">
<div class="col-md-3 d-flex justify-content-center my-1">
<a
class="d-block logo logo-openstartup"
href="https://openstartup.tm"
@ -130,7 +130,7 @@
title="Open Startup: The most complete list of open startups"
></a>
</div>
<div class="col-md-2 d-flex justify-content-center my-1">
<div class="col-md-3 d-flex justify-content-center my-1">
<a
class="d-block logo logo-privacy-tools mask"
href="https://www.privacytools.io"
@ -138,7 +138,7 @@
title="Privacy Tools: Software Alternatives and Encryption"
></a>
</div>
<div class="col-md-2 d-flex justify-content-center my-1">
<div class="col-md-3 d-flex justify-content-center my-1">
<a
class="d-block logo logo-product-hunt"
href="https://www.producthunt.com"
@ -146,7 +146,15 @@
title="Product Hunt – The best new products in tech."
></a>
</div>
<div class="col-md-2 d-flex justify-content-center my-1">
<div class="col-md-3 d-flex justify-content-center my-1">
<a
class="d-block logo logo-sackgeld mask"
href="https://www.sackgeld.com"
target="_blank"
title="Sackgeld.com – Apps für ein höheres Sackgeld"
></a>
</div>
<div class="col-md-3 d-flex justify-content-center my-1">
<a
class="d-block logo logo-unraid mask"
href="https://unraid.net"

5
apps/client/src/app/pages/landing/landing-page.scss

@ -75,6 +75,10 @@
filter: grayscale(1);
}
&.logo-sackgeld {
mask-image: url('/assets/images/logo-sackgeld.png');
}
&.logo-unraid {
mask-image: url('/assets/images/logo-unraid.svg');
}
@ -112,6 +116,7 @@
&.logo-agplv3,
&.logo-alternative-to,
&.logo-privacy-tools,
&.logo-sackgeld,
&.logo-unraid {
background-color: rgba(var(--light-primary-text));
}

BIN
apps/client/src/assets/images/logo-sackgeld.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 40 KiB

Loading…
Cancel
Save