|
|
@ -17,7 +17,11 @@ import { |
|
|
PortfolioPosition, |
|
|
PortfolioPosition, |
|
|
User |
|
|
User |
|
|
} from '@ghostfolio/common/interfaces'; |
|
|
} from '@ghostfolio/common/interfaces'; |
|
|
import { hasPermission, permissions } from '@ghostfolio/common/permissions'; |
|
|
import { |
|
|
|
|
|
hasPermission, |
|
|
|
|
|
hasReadRestrictedAccessPermission, |
|
|
|
|
|
permissions |
|
|
|
|
|
} from '@ghostfolio/common/permissions'; |
|
|
import { MarketAdvanced } from '@ghostfolio/common/types'; |
|
|
import { MarketAdvanced } from '@ghostfolio/common/types'; |
|
|
import { translate } from '@ghostfolio/ui/i18n'; |
|
|
import { translate } from '@ghostfolio/ui/i18n'; |
|
|
import { GfPortfolioProportionChartComponent } from '@ghostfolio/ui/portfolio-proportion-chart'; |
|
|
import { GfPortfolioProportionChartComponent } from '@ghostfolio/ui/portfolio-proportion-chart'; |
|
|
@ -97,6 +101,7 @@ export class GfAllocationsPageComponent implements OnInit { |
|
|
| 'name' |
|
|
| 'name' |
|
|
> & { etfProvider: string; value: number }; |
|
|
> & { etfProvider: string; value: number }; |
|
|
}; |
|
|
}; |
|
|
|
|
|
protected impersonationId: string | null; |
|
|
protected isLoading = false; |
|
|
protected isLoading = false; |
|
|
protected markets: PortfolioDetails['markets']; |
|
|
protected markets: PortfolioDetails['markets']; |
|
|
protected marketsAdvanced: { |
|
|
protected marketsAdvanced: { |
|
|
@ -170,6 +175,7 @@ export class GfAllocationsPageComponent implements OnInit { |
|
|
.pipe(takeUntilDestroyed(this.destroyRef)) |
|
|
.pipe(takeUntilDestroyed(this.destroyRef)) |
|
|
.subscribe((impersonationId) => { |
|
|
.subscribe((impersonationId) => { |
|
|
this.hasImpersonationId = !!impersonationId; |
|
|
this.hasImpersonationId = !!impersonationId; |
|
|
|
|
|
this.impersonationId = impersonationId; |
|
|
|
|
|
|
|
|
this.changeDetectorRef.markForCheck(); |
|
|
this.changeDetectorRef.markForCheck(); |
|
|
}); |
|
|
}); |
|
|
@ -224,7 +230,12 @@ export class GfAllocationsPageComponent implements OnInit { |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
protected showValuesInPercentage() { |
|
|
protected showValuesInPercentage() { |
|
|
return this.hasImpersonationId || this.user?.settings?.isRestrictedView; |
|
|
return ( |
|
|
|
|
|
hasReadRestrictedAccessPermission({ |
|
|
|
|
|
accesses: this.user?.access, |
|
|
|
|
|
impersonationId: this.impersonationId |
|
|
|
|
|
}) || this.user?.settings?.isRestrictedView |
|
|
|
|
|
); |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
private extractCurrency({ |
|
|
private extractCurrency({ |
|
|
@ -618,11 +629,11 @@ export class GfAllocationsPageComponent implements OnInit { |
|
|
data: { |
|
|
data: { |
|
|
accountId: aAccountId, |
|
|
accountId: aAccountId, |
|
|
deviceType: this.deviceType(), |
|
|
deviceType: this.deviceType(), |
|
|
hasImpersonationId: this.hasImpersonationId, |
|
|
|
|
|
hasPermissionToCreateActivity: |
|
|
hasPermissionToCreateActivity: |
|
|
!this.hasImpersonationId && |
|
|
!this.hasImpersonationId && |
|
|
hasPermission(this.user?.permissions, permissions.createActivity) && |
|
|
hasPermission(this.user?.permissions, permissions.createActivity) && |
|
|
!this.user?.settings?.isRestrictedView |
|
|
!this.user?.settings?.isRestrictedView, |
|
|
|
|
|
impersonationId: this.impersonationId |
|
|
}, |
|
|
}, |
|
|
height: this.deviceType() === 'mobile' ? '98vh' : '80vh', |
|
|
height: this.deviceType() === 'mobile' ? '98vh' : '80vh', |
|
|
width: this.deviceType() === 'mobile' ? '100vw' : '50rem' |
|
|
width: this.deviceType() === 'mobile' ? '100vw' : '50rem' |
|
|
|