Browse Source

Improve savingsRate on FIRE page

pull/7522/head
Thomas Kaul 4 weeks ago
parent
commit
8bc6c236e8
  1. 6
      apps/client/src/app/app.component.ts
  2. 6
      apps/client/src/app/pages/accounts/accounts-page.component.ts
  3. 4
      apps/client/src/app/pages/portfolio/allocations/allocations-page.component.ts
  4. 2
      apps/client/src/app/pages/portfolio/analysis/analysis-page.component.ts
  5. 2
      apps/client/src/app/pages/portfolio/fire/fire-page.html
  6. 2
      libs/common/src/lib/interfaces/responses/portfolio-investments.interface.ts

6
apps/client/src/app/app.component.ts

@ -57,7 +57,6 @@ export class GfAppComponent implements OnInit {
public currentRoute: string;
public currentSubRoute: string;
public deviceType: string;
public hasImpersonationId: boolean;
public hasInfoMessage: boolean;
public hasPermissionToChangeDateRange: boolean;
public hasPermissionToChangeFilters: boolean;
@ -117,7 +116,6 @@ export class GfAppComponent implements OnInit {
.onChangeHasImpersonation()
.pipe(takeUntilDestroyed(this.destroyRef))
.subscribe((impersonationId) => {
this.hasImpersonationId = !!impersonationId;
this.impersonationId = impersonationId;
});
@ -298,7 +296,7 @@ export class GfAppComponent implements OnInit {
permissions.accessAdminControl
),
hasPermissionToCreateActivity:
!this.hasImpersonationId &&
!this.impersonationId &&
hasPermission(
this.user?.permissions,
permissions.createActivity
@ -309,7 +307,7 @@ export class GfAppComponent implements OnInit {
permissions.reportDataGlitch
),
hasPermissionToUpdateActivity:
!this.hasImpersonationId &&
!this.impersonationId &&
hasPermission(
this.user?.permissions,
permissions.updateActivity

6
apps/client/src/app/pages/accounts/accounts-page.component.ts

@ -51,7 +51,6 @@ import { GfTransferBalanceDialogComponent } from './transfer-balance/transfer-ba
export class GfAccountsPageComponent implements OnInit {
protected accounts: AccountWithValue[];
protected activitiesCount = 0;
protected hasImpersonationId: boolean;
protected hasPermissionToCreateAccount: boolean;
protected hasPermissionToUpdateAccount: boolean;
protected impersonationId: string | null;
@ -105,12 +104,15 @@ export class GfAccountsPageComponent implements OnInit {
});
}
protected get hasImpersonationId() {
return !!this.impersonationId;
}
public ngOnInit() {
this.impersonationStorageService
.onChangeHasImpersonation()
.pipe(takeUntilDestroyed(this.destroyRef))
.subscribe((impersonationId) => {
this.hasImpersonationId = !!impersonationId;
this.impersonationId = impersonationId;
});

4
apps/client/src/app/pages/portfolio/allocations/allocations-page.component.ts

@ -89,7 +89,6 @@ export class GfAllocationsPageComponent implements OnInit {
protected readonly deviceType = computed(
() => this.deviceDetectorService.deviceInfo().deviceType
);
protected hasImpersonationId: boolean;
protected holdings: {
[symbol: string]: Pick<
PortfolioPosition['assetProfile'],
@ -174,7 +173,6 @@ export class GfAllocationsPageComponent implements OnInit {
.onChangeHasImpersonation()
.pipe(takeUntilDestroyed(this.destroyRef))
.subscribe((impersonationId) => {
this.hasImpersonationId = !!impersonationId;
this.impersonationId = impersonationId;
this.changeDetectorRef.markForCheck();
@ -630,7 +628,7 @@ export class GfAllocationsPageComponent implements OnInit {
accountId: aAccountId,
deviceType: this.deviceType(),
hasPermissionToCreateActivity:
!this.hasImpersonationId &&
!this.impersonationId &&
hasPermission(this.user?.permissions, permissions.createActivity) &&
!this.user?.settings?.isRestrictedView,
impersonationId: this.impersonationId

2
apps/client/src/app/pages/portfolio/analysis/analysis-page.component.ts

@ -104,7 +104,7 @@ export class GfAnalysisPageComponent implements OnInit {
protected performanceDataItemsInPercentage: HistoricalDataItem[];
protected readonly portfolioEvolutionDataLabel = $localize`Investment`;
protected precision = 2;
protected savingsRatePerMonth: number;
protected savingsRatePerMonth: number | undefined;
protected streaks: PortfolioInvestmentsResponse['streaks'];
protected top3: PortfolioPosition[];
protected unitCurrentStreak: string;

2
apps/client/src/app/pages/portfolio/fire/fire-page.html

@ -21,7 +21,7 @@
[locale]="user?.settings?.locale"
[projectedTotalAmount]="user?.settings?.projectedTotalAmount"
[retirementDate]="user?.settings?.retirementDate"
[savingsRate]="user?.settings?.savingsRate"
[savingsRate]="hasImpersonationId ? 0 : user?.settings?.savingsRate"
[style.opacity]="
user?.subscription?.type === 'Basic' ? '0.67' : 'initial'
"

2
libs/common/src/lib/interfaces/responses/portfolio-investments.interface.ts

@ -2,6 +2,6 @@ import { InvestmentItem } from '../investment-item.interface';
export interface PortfolioInvestmentsResponse {
investments: InvestmentItem[];
savingsRate: number;
savingsRate?: number;
streaks: { currentStreak: number; longestStreak: number };
}

Loading…
Cancel
Save