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. 21
      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 get showCurrencyErrorMessage() {
const addCurrencyFormControl =
this.createAssetProfileForm.get('addCurrency');
if (
addCurrencyFormControl.hasError('minlength') ||
addCurrencyFormControl.hasError('maxlength')
) {
return true;
}
return false;
}
public ngOnInit() {
this.fetchAdminData();
@ -153,16 +167,4 @@ export class CreateAssetProfileDialog implements OnInit, OnDestroy {
}, 300);
});
}
get showCurrencyErrorMessage() {
const addCurrencyFormControl =
this.createAssetProfileForm.get('addCurrency');
if (
addCurrencyFormControl.hasError('minlength') ||
addCurrencyFormControl.hasError('maxlength')
) {
return true;
}
return false;
}
}

21
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-label i18n>Currency</mat-label>
<input formControlName="addCurrency" matInput />
<mat-error
*ngIf="
createAssetProfileForm.get('addCurrency').hasError('required')
"
i18n
>
Currency is required.
</mat-error>
<mat-error *ngIf="showCurrencyErrorMessage" i18n>
{{ createAssetProfileForm.controls['addCurrency'].value }} is an
invalid currency! Should be of 3 characters only.
</mat-error>
@if (createAssetProfileForm.get('addCurrency').hasError('required')) {
<mat-error i18n>Currency is required.</mat-error>
}
@if (showCurrencyErrorMessage) {
<mat-error i18n>
{{ createAssetProfileForm.controls['addCurrency'].value }} is an
invalid currency! Should be of 3 characters only.
</mat-error>
}
</mat-form-field>
</div>
}

2
package.json

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

Loading…
Cancel
Save