Browse Source

Changes updated as per the latest suggestions

pull/3819/head
Madhab Sahoo 11 months ago
parent
commit
af5545f99b
  1. 26
      apps/client/src/app/components/admin-market-data/create-asset-profile-dialog/create-asset-profile-dialog.component.ts
  2. 15
      apps/client/src/app/components/admin-market-data/create-asset-profile-dialog/create-asset-profile-dialog.html
  3. 2
      package.json

26
apps/client/src/app/components/admin-market-data/create-asset-profile-dialog/create-asset-profile-dialog.component.ts

@ -45,6 +45,20 @@ export class CreateAssetProfileDialog implements OnInit, OnDestroy {
public readonly formBuilder: FormBuilder public readonly formBuilder: FormBuilder
) {} ) {}
public get showCurrencyErrorMessage() {
const addCurrencyFormControl =
this.createAssetProfileForm.get('addCurrency');
if (
addCurrencyFormControl.hasError('minlength') ||
addCurrencyFormControl.hasError('maxlength')
) {
return true;
}
return false;
}
public ngOnInit() { public ngOnInit() {
this.fetchAdminData(); this.fetchAdminData();
@ -153,16 +167,4 @@ export class CreateAssetProfileDialog implements OnInit, OnDestroy {
}, 300); }, 300);
}); });
} }
get showCurrencyErrorMessage() {
const addCurrencyFormControl =
this.createAssetProfileForm.get('addCurrency');
if (
addCurrencyFormControl.hasError('minlength') ||
addCurrencyFormControl.hasError('maxlength')
) {
return true;
}
return false;
}
} }

15
apps/client/src/app/components/admin-market-data/create-asset-profile-dialog/create-asset-profile-dialog.html

@ -45,18 +45,15 @@
<mat-form-field appearance="outline" class="w-100"> <mat-form-field appearance="outline" class="w-100">
<mat-label i18n>Currency</mat-label> <mat-label i18n>Currency</mat-label>
<input formControlName="addCurrency" matInput /> <input formControlName="addCurrency" matInput />
<mat-error @if (createAssetProfileForm.get('addCurrency').hasError('required')) {
*ngIf=" <mat-error i18n>Currency is required.</mat-error>
createAssetProfileForm.get('addCurrency').hasError('required') }
" @if (showCurrencyErrorMessage) {
i18n <mat-error i18n>
>
Currency is required.
</mat-error>
<mat-error *ngIf="showCurrencyErrorMessage" i18n>
{{ createAssetProfileForm.controls['addCurrency'].value }} is an {{ createAssetProfileForm.controls['addCurrency'].value }} is an
invalid currency! Should be of 3 characters only. invalid currency! Should be of 3 characters only.
</mat-error> </mat-error>
}
</mat-form-field> </mat-form-field>
</div> </div>
} }

2
package.json

@ -1,6 +1,6 @@
{ {
"name": "ghostfolio", "name": "ghostfolio",
"version": "2.111.0", "version": "2.110.0",
"homepage": "https://ghostfol.io", "homepage": "https://ghostfol.io",
"license": "AGPL-3.0", "license": "AGPL-3.0",
"repository": "https://github.com/ghostfolio/ghostfolio", "repository": "https://github.com/ghostfolio/ghostfolio",

Loading…
Cancel
Save