From 1e9d88bae1d83d834eea031f146ff011ec96f14d Mon Sep 17 00:00:00 2001 From: KenTandrian Date: Sun, 1 Feb 2026 15:05:56 +0700 Subject: [PATCH] fix(sb): run successful build --- .../lib/interfaces/lookup-item.interface.ts | 2 +- .../activities-table.component.stories.ts | 26 +++++++++---------- .../alert-dialog/alert-dialog.component.ts | 4 +-- .../confirmation-dialog.component.ts | 6 ++--- .../prompt-dialog/prompt-dialog.component.ts | 10 +++---- .../symbol-autocomplete.component.ts | 4 +-- .../tags-selector/tags-selector.component.ts | 14 +++++----- libs/ui/src/lib/value/value.component.ts | 2 +- 8 files changed, 35 insertions(+), 33 deletions(-) diff --git a/libs/common/src/lib/interfaces/lookup-item.interface.ts b/libs/common/src/lib/interfaces/lookup-item.interface.ts index fa91ed690..6cedeca09 100644 --- a/libs/common/src/lib/interfaces/lookup-item.interface.ts +++ b/libs/common/src/lib/interfaces/lookup-item.interface.ts @@ -7,7 +7,7 @@ export interface LookupItem { assetSubClass: AssetSubClass; currency: string; dataProviderInfo: DataProviderInfo; - dataSource: DataSource; + dataSource: DataSource | null; name: string; symbol: string; } diff --git a/libs/ui/src/lib/activities-table/activities-table.component.stories.ts b/libs/ui/src/lib/activities-table/activities-table.component.stories.ts index e7a2ba819..25463e576 100644 --- a/libs/ui/src/lib/activities-table/activities-table.component.stories.ts +++ b/libs/ui/src/lib/activities-table/activities-table.component.stories.ts @@ -59,7 +59,7 @@ const activities: Activity[] = [ SymbolProfile: { assetClass: 'EQUITY', assetSubClass: 'ETF', - comment: null, + comment: undefined, countries: [], createdAt: new Date('2021-06-06T16:12:20.982Z'), currency: 'USD', @@ -74,12 +74,12 @@ const activities: Activity[] = [ isin: 'US9220427424', name: 'Vanguard Total World Stock Index Fund ETF Shares', updatedAt: new Date('2025-10-01T20:09:39.500Z'), - scraperConfiguration: null, + scraperConfiguration: undefined, sectors: [], symbol: 'VT', symbolMapping: {}, url: 'https://www.vanguard.com', - userId: null, + userId: undefined, activitiesCount: 267, dateOfFirstActivity: new Date('2018-05-31T16:00:00.000Z') }, @@ -126,7 +126,7 @@ const activities: Activity[] = [ SymbolProfile: { assetClass: 'EQUITY', assetSubClass: 'ETF', - comment: null, + comment: undefined, countries: [], createdAt: new Date('2021-06-06T16:12:20.982Z'), currency: 'USD', @@ -141,12 +141,12 @@ const activities: Activity[] = [ isin: 'US9220427424', name: 'Vanguard Total World Stock Index Fund ETF Shares', updatedAt: new Date('2025-10-01T20:09:39.500Z'), - scraperConfiguration: null, + scraperConfiguration: undefined, sectors: [], symbol: 'VT', symbolMapping: {}, url: 'https://www.vanguard.com', - userId: null, + userId: undefined, activitiesCount: 267, dateOfFirstActivity: new Date('2018-05-31T16:00:00.000Z') }, @@ -193,7 +193,7 @@ const activities: Activity[] = [ SymbolProfile: { assetClass: 'LIQUIDITY', assetSubClass: 'CRYPTOCURRENCY', - comment: null, + comment: undefined, countries: [], createdAt: new Date('2024-03-12T15:15:21.217Z'), currency: 'USD', @@ -208,12 +208,12 @@ const activities: Activity[] = [ isin: 'CA4639181029', name: 'iShares Bitcoin Trust', updatedAt: new Date('2025-09-29T03:14:07.742Z'), - scraperConfiguration: null, + scraperConfiguration: undefined, sectors: [], symbol: 'IBIT', symbolMapping: {}, url: 'https://www.ishares.com', - userId: null, + userId: undefined, activitiesCount: 6, dateOfFirstActivity: new Date('2024-01-01T08:00:00.000Z') }, @@ -280,7 +280,7 @@ const activities: Activity[] = [ symbol: 'BNDW', symbolMapping: {}, url: 'https://vanguard.com', - userId: null, + userId: undefined, activitiesCount: 38, dateOfFirstActivity: new Date('2022-04-13T20:05:48.742Z') }, @@ -327,7 +327,7 @@ const activities: Activity[] = [ SymbolProfile: { assetClass: 'EQUITY', assetSubClass: 'ETF', - comment: null, + comment: undefined, countries: [], createdAt: new Date('2021-06-06T16:12:20.982Z'), currency: 'USD', @@ -342,12 +342,12 @@ const activities: Activity[] = [ isin: 'US9220427424', name: 'Vanguard Total World Stock Index Fund ETF Shares', updatedAt: new Date('2025-10-01T20:09:39.500Z'), - scraperConfiguration: null, + scraperConfiguration: undefined, sectors: [], symbol: 'VT', symbolMapping: {}, url: 'https://www.vanguard.com', - userId: null, + userId: undefined, activitiesCount: 267, dateOfFirstActivity: new Date('2018-05-31T16:00:00.000Z') }, diff --git a/libs/ui/src/lib/notifications/alert-dialog/alert-dialog.component.ts b/libs/ui/src/lib/notifications/alert-dialog/alert-dialog.component.ts index 33d26c493..acd63d995 100644 --- a/libs/ui/src/lib/notifications/alert-dialog/alert-dialog.component.ts +++ b/libs/ui/src/lib/notifications/alert-dialog/alert-dialog.component.ts @@ -11,8 +11,8 @@ import { AlertDialogParams } from './interfaces/interfaces'; templateUrl: './alert-dialog.html' }) export class GfAlertDialogComponent { - public discardLabel: string; - public message: string; + public discardLabel?: string; + public message?: string; public title: string; public constructor(public dialogRef: MatDialogRef) {} diff --git a/libs/ui/src/lib/notifications/confirmation-dialog/confirmation-dialog.component.ts b/libs/ui/src/lib/notifications/confirmation-dialog/confirmation-dialog.component.ts index a3bc053ee..ccbb3e737 100644 --- a/libs/ui/src/lib/notifications/confirmation-dialog/confirmation-dialog.component.ts +++ b/libs/ui/src/lib/notifications/confirmation-dialog/confirmation-dialog.component.ts @@ -13,10 +13,10 @@ import { ConfirmDialogParams } from './interfaces/interfaces'; templateUrl: './confirmation-dialog.html' }) export class GfConfirmationDialogComponent { - public confirmLabel: string; + public confirmLabel?: string; public confirmType: ConfirmationDialogType; - public discardLabel: string; - public message: string; + public discardLabel?: string; + public message?: string; public title: string; public constructor( diff --git a/libs/ui/src/lib/notifications/prompt-dialog/prompt-dialog.component.ts b/libs/ui/src/lib/notifications/prompt-dialog/prompt-dialog.component.ts index abfc7e154..f62116c83 100644 --- a/libs/ui/src/lib/notifications/prompt-dialog/prompt-dialog.component.ts +++ b/libs/ui/src/lib/notifications/prompt-dialog/prompt-dialog.component.ts @@ -18,25 +18,25 @@ import { MatInputModule } from '@angular/material/input'; }) export class GfPromptDialogComponent { public confirmLabel: string; - public defaultValue: string; + public defaultValue?: string; public discardLabel: string; public formControl = new FormControl(''); public title: string; - public valueLabel: string; + public valueLabel?: string; public constructor(public dialogRef: MatDialogRef) {} public initialize(aParams: { confirmLabel: string; - defaultValue: string; + defaultValue?: string; discardLabel: string; title: string; - valueLabel: string; + valueLabel?: string; }) { this.confirmLabel = aParams.confirmLabel; this.defaultValue = aParams.defaultValue; this.discardLabel = aParams.discardLabel; - this.formControl.setValue(aParams.defaultValue); + this.formControl.setValue(aParams.defaultValue ?? null); this.title = aParams.title; this.valueLabel = aParams.valueLabel; } diff --git a/libs/ui/src/lib/symbol-autocomplete/symbol-autocomplete.component.ts b/libs/ui/src/lib/symbol-autocomplete/symbol-autocomplete.component.ts index c74e8a077..e17044c3f 100644 --- a/libs/ui/src/lib/symbol-autocomplete/symbol-autocomplete.component.ts +++ b/libs/ui/src/lib/symbol-autocomplete/symbol-autocomplete.component.ts @@ -185,7 +185,7 @@ export class GfSymbolAutocompleteComponent public ngDoCheck() { if (this.ngControl) { this.validateRequired(); - this.errorState = this.ngControl.invalid && this.ngControl.touched; + this.errorState = !!(this.ngControl.invalid && this.ngControl.touched); this.stateChanges.next(); } } @@ -225,7 +225,7 @@ export class GfSymbolAutocompleteComponent ? !super.value?.dataSource || !super.value?.symbol : false; if (requiredCheck) { - this.ngControl.control.setErrors({ invalidData: true }); + this.ngControl.control?.setErrors({ invalidData: true }); } } } diff --git a/libs/ui/src/lib/tags-selector/tags-selector.component.ts b/libs/ui/src/lib/tags-selector/tags-selector.component.ts index 7f1a8805e..6ed742019 100644 --- a/libs/ui/src/lib/tags-selector/tags-selector.component.ts +++ b/libs/ui/src/lib/tags-selector/tags-selector.component.ts @@ -77,7 +77,7 @@ export class GfTagsSelectorComponent this.tagInputControl.valueChanges .pipe(takeUntil(this.unsubscribeSubject)) .subscribe((value) => { - this.filteredOptions.next(this.filterTags(value)); + this.filteredOptions.next(this.filterTags(value ?? '')); }); addIcons({ addCircleOutline, closeOutline }); @@ -100,21 +100,23 @@ export class GfTagsSelectorComponent if (!tag && this.hasPermissionToCreateTag) { tag = { - id: undefined, + id: '', name: event.option.value as string, userId: null }; } - this.tagsSelected.update((tags) => { - return [...(tags ?? []), tag]; - }); + if (tag) { + this.tagsSelected.update((tags) => { + return [...(tags ?? []), tag]; + }); + } const newTags = this.tagsSelected(); this.onChange(newTags); this.onTouched(); this.tagInput.nativeElement.value = ''; - this.tagInputControl.setValue(undefined); + this.tagInputControl.setValue(null); } public onRemoveTag(tag: Tag) { diff --git a/libs/ui/src/lib/value/value.component.ts b/libs/ui/src/lib/value/value.component.ts index e24c00322..10ba3798e 100644 --- a/libs/ui/src/lib/value/value.component.ts +++ b/libs/ui/src/lib/value/value.component.ts @@ -139,7 +139,7 @@ export class GfValueComponent implements OnChanges { this.isNumber = false; this.isString = false; this.locale = this.locale || getLocale(); - this.precision = this.precision >= 0 ? this.precision : undefined; + this.precision = this.precision >= 0 ? this.precision : 0; this.useAbsoluteValue = false; } }