|
|
@ -15,6 +15,7 @@ import { |
|
|
Component, |
|
|
Component, |
|
|
ElementRef, |
|
|
ElementRef, |
|
|
inject, |
|
|
inject, |
|
|
|
|
|
input, |
|
|
Input, |
|
|
Input, |
|
|
OnChanges, |
|
|
OnChanges, |
|
|
viewChild |
|
|
viewChild |
|
|
@ -34,7 +35,6 @@ import { NgxSkeletonLoaderModule } from 'ngx-skeleton-loader'; |
|
|
templateUrl: './portfolio-performance.component.html' |
|
|
templateUrl: './portfolio-performance.component.html' |
|
|
}) |
|
|
}) |
|
|
export class GfPortfolioPerformanceComponent implements OnChanges { |
|
|
export class GfPortfolioPerformanceComponent implements OnChanges { |
|
|
@Input() errors: ResponseError['errors']; |
|
|
|
|
|
@Input() isLoading: boolean; |
|
|
@Input() isLoading: boolean; |
|
|
@Input() locale = getLocale(); |
|
|
@Input() locale = getLocale(); |
|
|
@Input() performance: PortfolioPerformance; |
|
|
@Input() performance: PortfolioPerformance; |
|
|
@ -42,6 +42,8 @@ export class GfPortfolioPerformanceComponent implements OnChanges { |
|
|
@Input() showDetails: boolean; |
|
|
@Input() showDetails: boolean; |
|
|
@Input() unit: string; |
|
|
@Input() unit: string; |
|
|
|
|
|
|
|
|
|
|
|
public readonly errors = input<ResponseError['errors']>(); |
|
|
|
|
|
|
|
|
private readonly value = |
|
|
private readonly value = |
|
|
viewChild.required<ElementRef<HTMLSpanElement>>('value'); |
|
|
viewChild.required<ElementRef<HTMLSpanElement>>('value'); |
|
|
|
|
|
|
|
|
@ -84,13 +86,14 @@ export class GfPortfolioPerformanceComponent implements OnChanges { |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
protected onShowErrors() { |
|
|
protected onShowErrors() { |
|
|
if (!this.errors?.length) { |
|
|
const errors = this.errors(); |
|
|
|
|
|
if (!errors?.length) { |
|
|
return; |
|
|
return; |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
const errorMessageParts: string[] = []; |
|
|
const errorMessageParts: string[] = []; |
|
|
|
|
|
|
|
|
for (const error of this.errors) { |
|
|
for (const error of errors) { |
|
|
errorMessageParts.push(`${error.symbol} (${error.dataSource})`); |
|
|
errorMessageParts.push(`${error.symbol} (${error.dataSource})`); |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
|