From e471d939d511779e9a13d79e8714748a630c1de7 Mon Sep 17 00:00:00 2001 From: jassu2244 Date: Wed, 1 Oct 2025 23:44:26 +0530 Subject: [PATCH] migrated the tags selector component of the holding detail dialog to form control. --- .../holding-detail-dialog.component.ts | 12 ++++-------- .../holding-detail-dialog/holding-detail-dialog.html | 3 +-- 2 files changed, 5 insertions(+), 10 deletions(-) diff --git a/apps/client/src/app/components/holding-detail-dialog/holding-detail-dialog.component.ts b/apps/client/src/app/components/holding-detail-dialog/holding-detail-dialog.component.ts index 8f6616174..52f70c30f 100644 --- a/apps/client/src/app/components/holding-detail-dialog/holding-detail-dialog.component.ts +++ b/apps/client/src/app/components/holding-detail-dialog/holding-detail-dialog.component.ts @@ -100,7 +100,7 @@ import { HoldingDetailDialogParams } from './interfaces/interfaces'; templateUrl: 'holding-detail-dialog.html' }) export class GfHoldingDetailDialogComponent implements OnDestroy, OnInit { - public activityForm: FormGroup; + public holdingForm: FormGroup; public accounts: Account[]; public assetClass: string; public assetSubClass: string; @@ -178,7 +178,7 @@ export class GfHoldingDetailDialogComponent implements OnDestroy, OnInit { } public ngOnInit() { - this.activityForm = this.formBuilder.group({ + this.holdingForm = this.formBuilder.group({ tags: [] as string[] }); @@ -187,7 +187,7 @@ export class GfHoldingDetailDialogComponent implements OnDestroy, OnInit { { id: this.data.symbol, type: 'SYMBOL' } ]; - this.activityForm + this.holdingForm .get('tags') .valueChanges.pipe(takeUntil(this.unsubscribeSubject)) .subscribe((tags: Tag[]) => { @@ -427,7 +427,7 @@ export class GfHoldingDetailDialogComponent implements OnDestroy, OnInit { }; }); - this.activityForm.setValue({ tags: this.tags }, { emitEvent: false }); + this.holdingForm.setValue({ tags: this.tags }, { emitEvent: false }); this.transactionCount = transactionCount; this.totalItems = transactionCount; @@ -585,10 +585,6 @@ export class GfHoldingDetailDialogComponent implements OnDestroy, OnInit { } } - public onTagsChanged(tags: Tag[]) { - this.activityForm.get('tags').setValue(tags); - } - public onUpdateActivity(aActivity: Activity) { this.router.navigate( internalRoutes.portfolio.subRoutes.activities.routerLink, diff --git a/apps/client/src/app/components/holding-detail-dialog/holding-detail-dialog.html b/apps/client/src/app/components/holding-detail-dialog/holding-detail-dialog.html index 08dd05e4b..5b61c9209 100644 --- a/apps/client/src/app/components/holding-detail-dialog/holding-detail-dialog.html +++ b/apps/client/src/app/components/holding-detail-dialog/holding-detail-dialog.html @@ -412,11 +412,10 @@ @if (