diff --git a/CHANGELOG.md b/CHANGELOG.md index b27ee2188a..8706af0084 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -9,6 +9,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ### Changed +- Migrated the historical market data editor dialog from `ngModel` to form control - Upgraded `bull-board` from version `9.9.0` to `9.10.1` ## 3.72.0 - 2026-09-20 diff --git a/libs/ui/src/lib/historical-market-data-editor/historical-market-data-editor-dialog/historical-market-data-editor-dialog.component.ts b/libs/ui/src/lib/historical-market-data-editor/historical-market-data-editor-dialog/historical-market-data-editor-dialog.component.ts index 1b7b99fa21..0e2cce6509 100644 --- a/libs/ui/src/lib/historical-market-data-editor/historical-market-data-editor-dialog/historical-market-data-editor-dialog.component.ts +++ b/libs/ui/src/lib/historical-market-data-editor/historical-market-data-editor-dialog/historical-market-data-editor-dialog.component.ts @@ -7,11 +7,15 @@ import { CUSTOM_ELEMENTS_SCHEMA, DestroyRef, OnInit, - inject, - signal + inject } from '@angular/core'; import { takeUntilDestroyed } from '@angular/core/rxjs-interop'; -import { FormsModule, ReactiveFormsModule } from '@angular/forms'; +import { + FormControl, + FormGroup, + ReactiveFormsModule, + Validators +} from '@angular/forms'; import { MatButtonModule } from '@angular/material/button'; import { DateAdapter, MAT_DATE_LOCALE } from '@angular/material/core'; import { MatDatepickerModule } from '@angular/material/datepicker'; @@ -33,7 +37,6 @@ import { HistoricalMarketDataEditorDialogParams } from './interfaces/interfaces' changeDetection: ChangeDetectionStrategy.OnPush, host: { class: 'h-100' }, imports: [ - FormsModule, IonIcon, MatButtonModule, MatDatepickerModule, @@ -51,7 +54,10 @@ export class GfHistoricalMarketDataEditorDialogComponent implements OnInit { public readonly data = inject(MAT_DIALOG_DATA); - protected readonly marketPrice = signal(this.data.marketPrice); + protected readonly historicalMarketDataForm = new FormGroup({ + date: new FormControl({ disabled: true, value: this.data.dateString }), + marketPrice: new FormControl(this.data.marketPrice, Validators.required) + }); private readonly destroyRef = inject(DestroyRef); private readonly locale = @@ -84,14 +90,18 @@ export class GfHistoricalMarketDataEditorDialogComponent implements OnInit { }) .pipe(takeUntilDestroyed(this.destroyRef)) .subscribe(({ marketPrice }) => { - this.marketPrice.set(marketPrice); + this.historicalMarketDataForm.controls.marketPrice.setValue( + marketPrice + ); + this.historicalMarketDataForm.controls.marketPrice.markAsDirty(); this.changeDetectorRef.markForCheck(); }); } public onUpdate() { - const marketPrice = this.marketPrice(); + const marketPrice = + this.historicalMarketDataForm.controls.marketPrice.value; if (isNil(marketPrice)) { return; diff --git a/libs/ui/src/lib/historical-market-data-editor/historical-market-data-editor-dialog/historical-market-data-editor-dialog.html b/libs/ui/src/lib/historical-market-data-editor/historical-market-data-editor-dialog/historical-market-data-editor-dialog.html index 7e81836646..110980b2ca 100644 --- a/libs/ui/src/lib/historical-market-data-editor/historical-market-data-editor-dialog/historical-market-data-editor-dialog.html +++ b/libs/ui/src/lib/historical-market-data-editor/historical-market-data-editor-dialog/historical-market-data-editor-dialog.html @@ -1,15 +1,18 @@ -
+

Details for {{ data.symbol }}

Date Market Price {{ data.currency }} @@ -38,6 +40,7 @@ i18n-title mat-button title="Fetch market price" + type="button" (click)="onFetchSymbolForDate()" > @@ -45,8 +48,15 @@
- - +