Browse Source

chore(refactor): renaming variables

pull/4469/head
tobikugel 4 weeks ago
committed by Thomas Kaul
parent
commit
1f49a15dcd
  1. 18
      apps/client/src/app/components/admin-market-data/asset-profile-dialog/asset-profile-dialog.component.ts
  2. 8
      apps/client/src/app/components/admin-market-data/asset-profile-dialog/asset-profile-dialog.html

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

@ -71,7 +71,7 @@ export class AssetProfileDialog implements OnDestroy, OnInit {
public assetProfile: AdminMarketDataDetails['assetProfile'];
public assetProfileIdentifierForm = this.formBuilder.group(
{
editedSearchSymbol: new FormControl<AssetProfileIdentifier>(
symbol: new FormControl<AssetProfileIdentifier>(
{ symbol: null, dataSource: null },
[Validators.required]
)
@ -253,11 +253,11 @@ export class AssetProfileDialog implements OnDestroy, OnInit {
private isNewSymbolValid(control: AbstractControl): ValidationErrors {
const currentAssetProfileIdentifier: AssetProfileIdentifier | undefined =
control.get('editedSearchSymbol').value;
control.get('symbol').value;
if (
currentAssetProfileIdentifier.dataSource === this.data?.dataSource &&
currentAssetProfileIdentifier.symbol === this.data?.symbol
currentAssetProfileIdentifier?.dataSource === this.data?.dataSource &&
currentAssetProfileIdentifier?.symbol === this.data?.symbol
) {
return {
equalsPreviousSymbol: true
@ -340,10 +340,8 @@ export class AssetProfileDialog implements OnDestroy, OnInit {
public async onSubmitAssetProfileIdentifierForm() {
const assetProfileIdentifierData: UpdateAssetProfileDto = {
dataSource:
this.assetProfileIdentifierForm.get('editedSearchSymbol').value
.dataSource,
symbol:
this.assetProfileIdentifierForm.get('editedSearchSymbol').value.symbol
this.assetProfileIdentifierForm.get('symbol').value.dataSource,
symbol: this.assetProfileIdentifierForm.get('symbol').value.symbol
};
try {
@ -372,7 +370,7 @@ export class AssetProfileDialog implements OnDestroy, OnInit {
catchError((error: HttpErrorResponse) => {
if (error.status === 409) {
this.snackBar.open(
$localize`This symbol is already in use`,
$localize`This symbol is already in use.`,
undefined,
{
duration: ms('3 seconds')
@ -380,7 +378,7 @@ export class AssetProfileDialog implements OnDestroy, OnInit {
);
} else {
this.snackBar.open(
$localize`An error occurred while updating the symbol`,
$localize`An error occurred while updating the symbol.`,
undefined,
{
duration: ms('3 seconds')

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

@ -100,7 +100,7 @@
<mat-form-field appearance="outline" class="gf-spacer without-hint">
<mat-label i18n>Name, symbol or ISIN</mat-label>
<gf-symbol-autocomplete
formControlName="editedSearchSymbol"
formControlName="symbol"
[includeIndices]="true"
/>
</mat-form-field>
@ -110,10 +110,8 @@
mat-flat-button
type="submit"
[disabled]="
assetProfileIdentifierForm.hasError(
'invalidData',
'editedSearchSymbol'
) || assetProfileIdentifierForm.hasError('equalsPreviousSymbol')
assetProfileIdentifierForm.hasError('invalidData', 'symbol') ||
assetProfileIdentifierForm.hasError('equalsPreviousSymbol')
"
>
Apply

Loading…
Cancel
Save