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 assetProfile: AdminMarketDataDetails['assetProfile'];
public assetProfileIdentifierForm = this.formBuilder.group( public assetProfileIdentifierForm = this.formBuilder.group(
{ {
editedSearchSymbol: new FormControl<AssetProfileIdentifier>( symbol: new FormControl<AssetProfileIdentifier>(
{ symbol: null, dataSource: null }, { symbol: null, dataSource: null },
[Validators.required] [Validators.required]
) )
@ -253,11 +253,11 @@ export class AssetProfileDialog implements OnDestroy, OnInit {
private isNewSymbolValid(control: AbstractControl): ValidationErrors { private isNewSymbolValid(control: AbstractControl): ValidationErrors {
const currentAssetProfileIdentifier: AssetProfileIdentifier | undefined = const currentAssetProfileIdentifier: AssetProfileIdentifier | undefined =
control.get('editedSearchSymbol').value; control.get('symbol').value;
if ( if (
currentAssetProfileIdentifier.dataSource === this.data?.dataSource && currentAssetProfileIdentifier?.dataSource === this.data?.dataSource &&
currentAssetProfileIdentifier.symbol === this.data?.symbol currentAssetProfileIdentifier?.symbol === this.data?.symbol
) { ) {
return { return {
equalsPreviousSymbol: true equalsPreviousSymbol: true
@ -340,10 +340,8 @@ export class AssetProfileDialog implements OnDestroy, OnInit {
public async onSubmitAssetProfileIdentifierForm() { public async onSubmitAssetProfileIdentifierForm() {
const assetProfileIdentifierData: UpdateAssetProfileDto = { const assetProfileIdentifierData: UpdateAssetProfileDto = {
dataSource: dataSource:
this.assetProfileIdentifierForm.get('editedSearchSymbol').value this.assetProfileIdentifierForm.get('symbol').value.dataSource,
.dataSource, symbol: this.assetProfileIdentifierForm.get('symbol').value.symbol
symbol:
this.assetProfileIdentifierForm.get('editedSearchSymbol').value.symbol
}; };
try { try {
@ -372,7 +370,7 @@ export class AssetProfileDialog implements OnDestroy, OnInit {
catchError((error: HttpErrorResponse) => { catchError((error: HttpErrorResponse) => {
if (error.status === 409) { if (error.status === 409) {
this.snackBar.open( this.snackBar.open(
$localize`This symbol is already in use`, $localize`This symbol is already in use.`,
undefined, undefined,
{ {
duration: ms('3 seconds') duration: ms('3 seconds')
@ -380,7 +378,7 @@ export class AssetProfileDialog implements OnDestroy, OnInit {
); );
} else { } else {
this.snackBar.open( this.snackBar.open(
$localize`An error occurred while updating the symbol`, $localize`An error occurred while updating the symbol.`,
undefined, undefined,
{ {
duration: ms('3 seconds') 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-form-field appearance="outline" class="gf-spacer without-hint">
<mat-label i18n>Name, symbol or ISIN</mat-label> <mat-label i18n>Name, symbol or ISIN</mat-label>
<gf-symbol-autocomplete <gf-symbol-autocomplete
formControlName="editedSearchSymbol" formControlName="symbol"
[includeIndices]="true" [includeIndices]="true"
/> />
</mat-form-field> </mat-form-field>
@ -110,10 +110,8 @@
mat-flat-button mat-flat-button
type="submit" type="submit"
[disabled]=" [disabled]="
assetProfileIdentifierForm.hasError( assetProfileIdentifierForm.hasError('invalidData', 'symbol') ||
'invalidData', assetProfileIdentifierForm.hasError('equalsPreviousSymbol')
'editedSearchSymbol'
) || assetProfileIdentifierForm.hasError('equalsPreviousSymbol')
" "
> >
Apply Apply

Loading…
Cancel
Save