Browse Source

Bugfix/show transfer balance button based on permission (#2489)

* Show button depending on permission

* Update changelog
pull/2492/head
Thomas Kaul 12 months ago
committed by GitHub
parent
commit
bf816c3b89
No known key found for this signature in database GPG Key ID: 4AEE18F83AFDEB23
  1. 6
      CHANGELOG.md
  2. 2
      apps/client/src/app/components/accounts-table/accounts-table.component.html
  3. 6
      apps/client/src/app/pages/accounts/accounts-page.component.ts
  4. 2
      apps/client/src/app/pages/accounts/accounts-page.html

6
CHANGELOG.md

@ -5,6 +5,12 @@ All notable changes to this project will be documented in this file.
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
## Unreleased
### Fixed
- Displayed the transfer cash balance button based on a permission
## 2.11.0 - 2023-10-14
### Added

2
apps/client/src/app/components/accounts-table/accounts-table.component.html

@ -1,4 +1,4 @@
<div class="d-flex justify-content-end">
<div *ngIf="showActions" class="d-flex justify-content-end">
<button
class="align-items-center d-flex"
mat-stroked-button

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

@ -30,7 +30,7 @@ export class AccountsPageComponent implements OnDestroy, OnInit {
public deviceType: string;
public hasImpersonationId: boolean;
public hasPermissionToCreateAccount: boolean;
public hasPermissionToDeleteAccount: boolean;
public hasPermissionToUpdateAccount: boolean;
public routeQueryParams: Subscription;
public totalBalanceInBaseCurrency = 0;
public totalValueInBaseCurrency = 0;
@ -95,9 +95,9 @@ export class AccountsPageComponent implements OnDestroy, OnInit {
this.user.permissions,
permissions.createAccount
);
this.hasPermissionToDeleteAccount = hasPermission(
this.hasPermissionToUpdateAccount = hasPermission(
this.user.permissions,
permissions.deleteAccount
permissions.updateAccount
);
this.changeDetectorRef.markForCheck();

2
apps/client/src/app/pages/accounts/accounts-page.html

@ -8,7 +8,7 @@
[baseCurrency]="user?.settings?.baseCurrency"
[deviceType]="deviceType"
[locale]="user?.settings?.locale"
[showActions]="!hasImpersonationId && hasPermissionToDeleteAccount && !user.settings.isRestrictedView"
[showActions]="!hasImpersonationId && hasPermissionToUpdateAccount && !user.settings.isRestrictedView"
[totalBalanceInBaseCurrency]="totalBalanceInBaseCurrency"
[totalValueInBaseCurrency]="totalValueInBaseCurrency"
[transactionCount]="transactionCount"

Loading…
Cancel
Save