Browse Source

Refactoring

pull/2581/head
Thomas 2 years ago
parent
commit
5c55947f92
  1. 6
      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

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

@ -189,20 +189,20 @@ export class AssetProfileDialog implements OnDestroy, OnInit {
symbol: this.data.symbol symbol: this.data.symbol
}) })
.pipe( .pipe(
takeUntil(this.unsubscribeSubject),
catchError(({ error, message }) => { catchError(({ error, message }) => {
this.snackBar.open(`${error}: ${message[0]}`, undefined, { this.snackBar.open(`${error}: ${message[0]}`, undefined, {
duration: 3000 duration: 3000
}); });
return EMPTY; return EMPTY;
}) }),
takeUntil(this.unsubscribeSubject)
) )
.subscribe(() => { .subscribe(() => {
this.initialize(); this.initialize();
}); });
} catch { } catch {
this.snackBar.open( this.snackBar.open(
$localize`Oops! Could not parse historical data`, $localize`Oops! Could not parse historical data.`,
undefined, undefined,
{ duration: 3000 } { duration: 3000 }
); );

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

@ -73,7 +73,7 @@
color="accent" color="accent"
mat-flat-button mat-flat-button
type="button" type="button"
[disabled]="assetProfileForm.controls['historicalData']?.controls['csvString']?.value === ''" [disabled]="!assetProfileForm.controls['historicalData']?.controls['csvString'].touched || assetProfileForm.controls['historicalData']?.controls['csvString']?.value === ''"
(click)="onImportHistoricalData()" (click)="onImportHistoricalData()"
> >
<ng-container i18n>Import</ng-container> <ng-container i18n>Import</ng-container>
@ -178,13 +178,13 @@
</ng-container> </ng-container>
</div> </div>
<div *ngIf="assetProfile?.dataSource === 'MANUAL'" class="mt-3"> <div *ngIf="assetProfile?.dataSource === 'MANUAL'" class="mt-3">
<mat-form-field appearance="outline" class="w-100"> <mat-form-field appearance="outline" class="w-100 without-hint">
<mat-label i18n>Name</mat-label> <mat-label i18n>Name</mat-label>
<input formControlName="name" matInput type="text" /> <input formControlName="name" matInput type="text" />
</mat-form-field> </mat-form-field>
</div> </div>
<div *ngIf="assetProfile?.dataSource === 'MANUAL'" class="mt-3"> <div *ngIf="assetProfile?.dataSource === 'MANUAL'" class="mt-3">
<mat-form-field appearance="outline" class="w-100"> <mat-form-field appearance="outline" class="w-100 without-hint">
<mat-label i18n>Asset Class</mat-label> <mat-label i18n>Asset Class</mat-label>
<mat-select formControlName="assetClass"> <mat-select formControlName="assetClass">
<mat-option [value]="null"></mat-option> <mat-option [value]="null"></mat-option>
@ -197,7 +197,7 @@
</mat-form-field> </mat-form-field>
</div> </div>
<div *ngIf="assetProfile?.dataSource === 'MANUAL'" class="mt-3"> <div *ngIf="assetProfile?.dataSource === 'MANUAL'" class="mt-3">
<mat-form-field appearance="outline" class="w-100"> <mat-form-field appearance="outline" class="w-100 without-hint">
<mat-label i18n>Asset Sub Class</mat-label> <mat-label i18n>Asset Sub Class</mat-label>
<mat-select formControlName="assetSubClass"> <mat-select formControlName="assetSubClass">
<mat-option [value]="null"></mat-option> <mat-option [value]="null"></mat-option>

Loading…
Cancel
Save