Browse Source

feat(client): enforce encapsulation

pull/6965/head
KenTandrian 3 months ago
parent
commit
bc4016dd06
  1. 68
      apps/client/src/app/pages/portfolio/analysis/analysis-page.component.ts

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

@ -68,42 +68,42 @@ import { NgxSkeletonLoaderModule } from 'ngx-skeleton-loader';
templateUrl: './analysis-page.html' templateUrl: './analysis-page.html'
}) })
export class GfAnalysisPageComponent implements OnInit { export class GfAnalysisPageComponent implements OnInit {
public benchmark?: Partial<SymbolProfile>; protected benchmark?: Partial<SymbolProfile>;
public benchmarkDataItems: HistoricalDataItem[] = []; protected benchmarkDataItems: HistoricalDataItem[] = [];
public benchmarks: Partial<SymbolProfile>[]; protected benchmarks: Partial<SymbolProfile>[];
public bottom3: PortfolioPosition[]; protected bottom3: PortfolioPosition[];
public deviceType: string; protected dividendsByGroup: InvestmentItem[];
public dividendsByGroup: InvestmentItem[]; protected dividendTimelineDataLabel = $localize`Dividend`;
public dividendTimelineDataLabel = $localize`Dividend`; protected hasImpersonationId: boolean;
public firstOrderDate: Date; protected hasPermissionToReadAiPrompt: boolean;
public hasImpersonationId: boolean; protected investments: InvestmentItem[];
public hasPermissionToReadAiPrompt: boolean; protected investmentTimelineDataLabel = $localize`Investment`;
public investments: InvestmentItem[]; protected investmentsByGroup: InvestmentItem[];
public investmentTimelineDataLabel = $localize`Investment`; protected isLoadingAnalysisPrompt: boolean;
public investmentsByGroup: InvestmentItem[]; protected isLoadingBenchmarkComparator: boolean;
public isLoadingAnalysisPrompt: boolean; protected isLoadingDividendTimelineChart: boolean;
public isLoadingBenchmarkComparator: boolean; protected isLoadingInvestmentChart: boolean;
public isLoadingDividendTimelineChart: boolean; protected isLoadingInvestmentTimelineChart: boolean;
public isLoadingInvestmentChart: boolean; protected isLoadingPortfolioPrompt: boolean;
public isLoadingInvestmentTimelineChart: boolean; protected mode: GroupBy = 'month';
public isLoadingPortfolioPrompt: boolean; protected modeOptions: ToggleOption[] = [
public mode: GroupBy = 'month';
public modeOptions: ToggleOption[] = [
{ label: $localize`Monthly`, value: 'month' }, { label: $localize`Monthly`, value: 'month' },
{ label: $localize`Yearly`, value: 'year' } { label: $localize`Yearly`, value: 'year' }
]; ];
public performance: PortfolioPerformance; protected performance: PortfolioPerformance;
public performanceDataItems: HistoricalDataItem[]; protected performanceDataItems: HistoricalDataItem[];
public performanceDataItemsInPercentage: HistoricalDataItem[]; protected performanceDataItemsInPercentage: HistoricalDataItem[];
public portfolioEvolutionDataLabel = $localize`Investment`; protected portfolioEvolutionDataLabel = $localize`Investment`;
public precision = 2; protected precision = 2;
public streaks: PortfolioInvestmentsResponse['streaks']; protected streaks: PortfolioInvestmentsResponse['streaks'];
public top3: PortfolioPosition[]; protected top3: PortfolioPosition[];
public unitCurrentStreak: string; protected unitCurrentStreak: string;
public unitLongestStreak: string; protected unitLongestStreak: string;
public user: User; protected user: User;
private readonly actionsMenuButton = viewChild.required(MatMenuTrigger); private readonly actionsMenuButton = viewChild.required(MatMenuTrigger);
private deviceType: string;
private firstOrderDate: Date;
private readonly changeDetectorRef = inject(ChangeDetectorRef); private readonly changeDetectorRef = inject(ChangeDetectorRef);
private readonly clipboard = inject(Clipboard); private readonly clipboard = inject(Clipboard);
@ -168,7 +168,7 @@ export class GfAnalysisPageComponent implements OnInit {
}); });
} }
public onChangeBenchmark(symbolProfileId: string) { protected onChangeBenchmark(symbolProfileId: string) {
this.dataService this.dataService
.putUserSetting({ benchmark: symbolProfileId }) .putUserSetting({ benchmark: symbolProfileId })
.pipe(takeUntilDestroyed(this.destroyRef)) .pipe(takeUntilDestroyed(this.destroyRef))
@ -184,12 +184,12 @@ export class GfAnalysisPageComponent implements OnInit {
}); });
} }
public onChangeGroupBy(aMode: GroupBy) { protected onChangeGroupBy(aMode: GroupBy) {
this.mode = aMode; this.mode = aMode;
this.fetchDividendsAndInvestments(); this.fetchDividendsAndInvestments();
} }
public onCopyPromptToClipboard(mode: AiPromptMode) { protected onCopyPromptToClipboard(mode: AiPromptMode) {
if (mode === 'analysis') { if (mode === 'analysis') {
this.isLoadingAnalysisPrompt = true; this.isLoadingAnalysisPrompt = true;
} else if (mode === 'portfolio') { } else if (mode === 'portfolio') {

Loading…
Cancel
Save