Browse Source

Task/refactor showValuesInPercentage() in account detail dialog component (#6698)

* Refactoring
pull/6725/head
Thomas Kaul 3 days ago
committed by GitHub
parent
commit
66dbde6789
No known key found for this signature in database GPG Key ID: B5690EEEBB952194
  1. 6
      apps/client/src/app/components/account-detail-dialog/account-detail-dialog.component.ts
  2. 8
      apps/client/src/app/components/account-detail-dialog/account-detail-dialog.html

6
apps/client/src/app/components/account-detail-dialog/account-detail-dialog.component.ts

@ -208,6 +208,12 @@ export class GfAccountDetailDialogComponent implements OnInit {
this.dialogRef.close(); this.dialogRef.close();
} }
public showValuesInPercentage() {
return (
this.data.hasImpersonationId || this.user?.settings?.isRestrictedView
);
}
private fetchAccount() { private fetchAccount() {
this.dataService this.dataService
.fetchAccount(this.data.accountId) .fetchAccount(this.data.accountId)

8
apps/client/src/app/components/account-detail-dialog/account-detail-dialog.html

@ -24,9 +24,7 @@
class="h-100" class="h-100"
[currency]="user?.settings?.baseCurrency" [currency]="user?.settings?.baseCurrency"
[historicalDataItems]="historicalDataItems" [historicalDataItems]="historicalDataItems"
[isInPercentage]=" [isInPercentage]="showValuesInPercentage()"
data.hasImpersonationId || user.settings.isRestrictedView
"
[isLoading]="isLoadingChart" [isLoading]="isLoadingChart"
[locale]="user?.settings?.locale" [locale]="user?.settings?.locale"
/> />
@ -118,9 +116,7 @@
[deviceType]="data.deviceType" [deviceType]="data.deviceType"
[hasPermissionToCreateActivity]="false" [hasPermissionToCreateActivity]="false"
[hasPermissionToDeleteActivity]="false" [hasPermissionToDeleteActivity]="false"
[hasPermissionToExportActivities]=" [hasPermissionToExportActivities]="!showValuesInPercentage()"
!data.hasImpersonationId && !user.settings.isRestrictedView
"
[hasPermissionToFilter]="false" [hasPermissionToFilter]="false"
[hasPermissionToOpenDetails]="false" [hasPermissionToOpenDetails]="false"
[locale]="user?.settings?.locale" [locale]="user?.settings?.locale"

Loading…
Cancel
Save