Browse Source

refactor: code review

pull/4497/head
tobikugel 2 weeks ago
parent
commit
eb687604da
  1. 3
      apps/api/src/app/import/import.service.ts
  2. 8
      apps/client/src/app/components/admin-market-data/asset-profile-dialog/asset-profile-dialog.component.ts
  3. 19
      apps/client/src/app/components/admin-market-data/asset-profile-dialog/asset-profile-dialog.html

3
apps/api/src/app/import/import.service.ts

@ -510,6 +510,7 @@ export class ImportService {
dataSource,
date: dateString,
fee,
isActive,
quantity,
symbol,
type,
@ -546,7 +547,7 @@ export class ImportService {
SymbolProfile: {
currency,
dataSource,
isActive: false,
isActive,
symbol,
activitiesCount: undefined,
assetClass: undefined,

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

@ -89,7 +89,7 @@ export class AssetProfileDialog implements OnDestroy, OnInit {
historicalData: this.formBuilder.group({
csvString: ''
}),
isActive: [false],
isActive: [true],
name: ['', Validators.required],
scraperConfiguration: this.formBuilder.group({
defaultMarketPrice: null,
@ -542,14 +542,14 @@ export class AssetProfileDialog implements OnDestroy, OnInit {
});
}
public onToggleIsActive(event: MatCheckboxChange) {
if (event.checked) {
public onToggleIsActive({ checked }: MatCheckboxChange) {
if (checked) {
this.assetProfileForm.get('isActive')?.setValue(true);
} else {
this.assetProfileForm.get('isActive')?.setValue(false);
}
if (event.checked === this.assetProfile.isActive) {
if (checked === this.assetProfile.isActive) {
this.assetProfileForm.get('isActive')?.markAsPristine();
} else {
this.assetProfileForm.get('isActive')?.markAsDirty();

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

@ -513,15 +513,16 @@
</div>
<div class="d-flex" mat-dialog-actions>
<mat-checkbox
class="gf-spacer"
color="primary"
[checked]="assetProfile?.isActive ?? false"
[disabled]="isEditAssetProfileIdentifierMode"
(change)="onToggleIsActive($event)"
>
<ng-container i18n>Active</ng-container>
</mat-checkbox>
<div class="gf-spacer">
<mat-checkbox
color="primary"
[checked]="assetProfile?.isActive ?? false"
[disabled]="isEditAssetProfileIdentifierMode"
(change)="onToggleIsActive($event)"
>
<ng-container i18n>Active</ng-container>
</mat-checkbox>
</div>
<button i18n mat-button type="button" (click)="onClose()">Cancel</button>
<button
color="primary"

Loading…
Cancel
Save