Browse Source

fix: disable account id input field

pull/2408/head
Sanjeev Sharma 2 years ago
parent
commit
4ece4e49c9
  1. 8
      apps/client/src/app/pages/accounts/create-or-update-account-dialog/create-or-update-account-dialog.component.ts
  2. 1
      apps/client/src/app/pages/accounts/create-or-update-account-dialog/create-or-update-account-dialog.html

8
apps/client/src/app/pages/accounts/create-or-update-account-dialog/create-or-update-account-dialog.component.ts

@ -28,9 +28,9 @@ export class CreateOrUpdateAccountDialog implements OnDestroy {
private unsubscribeSubject = new Subject<void>(); private unsubscribeSubject = new Subject<void>();
public constructor( public constructor(
@Inject(MAT_DIALOG_DATA) public data: CreateOrUpdateAccountDialogParams,
private dataService: DataService, private dataService: DataService,
public dialogRef: MatDialogRef<CreateOrUpdateAccountDialog>, public dialogRef: MatDialogRef<CreateOrUpdateAccountDialog>,
@Inject(MAT_DIALOG_DATA) public data: CreateOrUpdateAccountDialogParams,
private formBuilder: FormBuilder private formBuilder: FormBuilder
) {} ) {}
@ -41,13 +41,13 @@ export class CreateOrUpdateAccountDialog implements OnDestroy {
this.platforms = platforms; this.platforms = platforms;
this.accountForm = this.formBuilder.group({ this.accountForm = this.formBuilder.group({
accountId: [this.data.account.id], accountId: [{ value: this.data.account.id, disabled: true }],
balance: [this.data.account.balance, Validators.required], balance: [this.data.account.balance, Validators.required],
comment: [this.data.account.comment], comment: [this.data.account.comment],
currency: [this.data.account.currency, Validators.required], currency: [this.data.account.currency, Validators.required],
isExcluded: [this.data.account.isExcluded], isExcluded: [this.data.account.isExcluded],
platformId: [this.data.account.platformId], name: [this.data.account.name, Validators.required],
name: [this.data.account.name, Validators.required] platformId: [this.data.account.platformId]
}); });
} }

1
apps/client/src/app/pages/accounts/create-or-update-account-dialog/create-or-update-account-dialog.html

@ -69,7 +69,6 @@
<mat-form-field appearance="outline" class="w-100"> <mat-form-field appearance="outline" class="w-100">
<mat-label i18n>Account ID</mat-label> <mat-label i18n>Account ID</mat-label>
<input <input
disabled
formControlName="accountId" formControlName="accountId"
matInput matInput
/> />

Loading…
Cancel
Save