fix update activity, hide update cash balance on edit (#1959)
* Fix update activity, hide update cash balance on edit * Update changelog
This commit is contained in:
@@ -12,6 +12,10 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
|||||||
- Improved the market price on the first buy date in the chart of the position detail dialog
|
- Improved the market price on the first buy date in the chart of the position detail dialog
|
||||||
- Restructured the admin control panel with a new settings tab
|
- Restructured the admin control panel with a new settings tab
|
||||||
|
|
||||||
|
### Fixed
|
||||||
|
|
||||||
|
- Fixed an error that occurred while editing an activity caused by the cash balance update
|
||||||
|
|
||||||
## 1.268.0 - 2023-05-08
|
## 1.268.0 - 2023-05-08
|
||||||
|
|
||||||
### Added
|
### Added
|
||||||
|
@@ -68,5 +68,5 @@ export class CreateOrderDto {
|
|||||||
|
|
||||||
@IsBoolean()
|
@IsBoolean()
|
||||||
@IsOptional()
|
@IsOptional()
|
||||||
updateAccountBalance: boolean;
|
updateAccountBalance?: boolean;
|
||||||
}
|
}
|
||||||
|
@@ -67,8 +67,4 @@ export class UpdateOrderDto {
|
|||||||
|
|
||||||
@IsNumber()
|
@IsNumber()
|
||||||
unitPrice: number;
|
unitPrice: number;
|
||||||
|
|
||||||
@IsBoolean()
|
|
||||||
@IsOptional()
|
|
||||||
updateAccountBalance: boolean;
|
|
||||||
}
|
}
|
||||||
|
@@ -415,13 +415,14 @@ export class CreateOrUpdateActivityDialog implements OnDestroy {
|
|||||||
: this.activityForm.controls['searchSymbol'].value.symbol,
|
: this.activityForm.controls['searchSymbol'].value.symbol,
|
||||||
tags: this.activityForm.controls['tags'].value,
|
tags: this.activityForm.controls['tags'].value,
|
||||||
type: this.activityForm.controls['type'].value,
|
type: this.activityForm.controls['type'].value,
|
||||||
unitPrice: this.activityForm.controls['unitPrice'].value,
|
unitPrice: this.activityForm.controls['unitPrice'].value
|
||||||
updateAccountBalance:
|
|
||||||
this.activityForm.controls['updateAccountBalance'].value
|
|
||||||
};
|
};
|
||||||
|
|
||||||
if (this.data.activity.id) {
|
if (this.data.activity.id) {
|
||||||
(activity as UpdateOrderDto).id = this.data.activity.id;
|
(activity as UpdateOrderDto).id = this.data.activity.id;
|
||||||
|
} else {
|
||||||
|
(activity as CreateOrderDto).updateAccountBalance =
|
||||||
|
this.activityForm.controls['updateAccountBalance'].value;
|
||||||
}
|
}
|
||||||
|
|
||||||
this.dialogRef.close({ activity });
|
this.dialogRef.close({ activity });
|
||||||
|
@@ -18,8 +18,12 @@
|
|||||||
</mat-select>
|
</mat-select>
|
||||||
</mat-form-field>
|
</mat-form-field>
|
||||||
</div>
|
</div>
|
||||||
<div>
|
<div [ngClass]="{'mb-3': data.activity.id}">
|
||||||
<mat-form-field appearance="outline" class="mb-1 without-hint w-100">
|
<mat-form-field
|
||||||
|
appearance="outline"
|
||||||
|
class="w-100"
|
||||||
|
[ngClass]="{'mb-1 without-hint': !data.activity.id}"
|
||||||
|
>
|
||||||
<mat-label i18n>Account</mat-label>
|
<mat-label i18n>Account</mat-label>
|
||||||
<mat-select formControlName="accountId">
|
<mat-select formControlName="accountId">
|
||||||
<mat-option
|
<mat-option
|
||||||
@@ -32,7 +36,7 @@
|
|||||||
</mat-select>
|
</mat-select>
|
||||||
</mat-form-field>
|
</mat-form-field>
|
||||||
</div>
|
</div>
|
||||||
<div class="mb-3">
|
<div class="mb-3" [ngClass]="{'d-none': data.activity.id}">
|
||||||
<mat-checkbox color="primary" formControlName="updateAccountBalance" i18n
|
<mat-checkbox color="primary" formControlName="updateAccountBalance" i18n
|
||||||
>Update Cash Balance</mat-checkbox
|
>Update Cash Balance</mat-checkbox
|
||||||
>
|
>
|
||||||
|
Reference in New Issue
Block a user