Kenrick Tandrian
1 day ago
committed by
GitHub
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
11 changed files with
29 additions and
19 deletions
-
libs/common/src/lib/interfaces/lookup-item.interface.ts
-
libs/ui/src/lib/holdings-table/holdings-table.component.ts
-
libs/ui/src/lib/no-transactions-info/no-transactions-info.component.ts
-
libs/ui/src/lib/portfolio-proportion-chart/portfolio-proportion-chart.component.ts
-
libs/ui/src/lib/services/admin.service.ts
-
libs/ui/src/lib/services/data.service.ts
-
libs/ui/src/lib/shared/abstract-mat-form-field.ts
-
libs/ui/src/lib/symbol-autocomplete/symbol-autocomplete.component.ts
-
libs/ui/src/lib/tags-selector/tags-selector.component.ts
-
libs/ui/src/lib/toggle/toggle.component.ts
-
libs/ui/tsconfig.json
|
|
|
@ -7,7 +7,7 @@ export interface LookupItem { |
|
|
|
assetSubClass: AssetSubClass; |
|
|
|
currency: string; |
|
|
|
dataProviderInfo: DataProviderInfo; |
|
|
|
dataSource: DataSource; |
|
|
|
dataSource: DataSource | null; |
|
|
|
name: string; |
|
|
|
symbol: string; |
|
|
|
} |
|
|
|
|
|
|
|
@ -106,6 +106,7 @@ export class GfHoldingsTableComponent { |
|
|
|
protected canShowDetails(holding: PortfolioPosition): boolean { |
|
|
|
return ( |
|
|
|
this.hasPermissionToOpenDetails() && |
|
|
|
!!holding.assetSubClass && |
|
|
|
!this.ignoreAssetSubClasses.includes(holding.assetSubClass) |
|
|
|
); |
|
|
|
} |
|
|
|
|
|
|
|
@ -24,5 +24,5 @@ export class GfNoTransactionsInfoComponent { |
|
|
|
@HostBinding('class.has-border') @Input() hasBorder = true; |
|
|
|
|
|
|
|
public routerLinkPortfolioActivities = |
|
|
|
internalRoutes.portfolio.subRoutes.activities.routerLink; |
|
|
|
internalRoutes.portfolio.subRoutes?.activities.routerLink; |
|
|
|
} |
|
|
|
|
|
|
|
@ -140,16 +140,18 @@ export class GfPortfolioProportionChartComponent |
|
|
|
|
|
|
|
if ( |
|
|
|
chartData[this.data[symbol][this.keys[0]].toUpperCase()] |
|
|
|
.subCategory[this.data[symbol][this.keys[1]]] |
|
|
|
?.subCategory?.[this.data[symbol][this.keys[1]]] |
|
|
|
) { |
|
|
|
// @ts-ignore
|
|
|
|
chartData[ |
|
|
|
this.data[symbol][this.keys[0]].toUpperCase() |
|
|
|
].subCategory[this.data[symbol][this.keys[1]]].value = chartData[ |
|
|
|
this.data[symbol][this.keys[0]].toUpperCase() |
|
|
|
].subCategory[this.data[symbol][this.keys[1]]].value.plus( |
|
|
|
].subCategory?.[this.data[symbol][this.keys[1]]].value.plus( |
|
|
|
this.data[symbol].value || 0 |
|
|
|
); |
|
|
|
} else { |
|
|
|
// @ts-ignore
|
|
|
|
chartData[ |
|
|
|
this.data[symbol][this.keys[0]].toUpperCase() |
|
|
|
].subCategory[this.data[symbol][this.keys[1]] ?? UNKNOWN_KEY] = { |
|
|
|
@ -278,12 +280,14 @@ export class GfPortfolioProportionChartComponent |
|
|
|
|
|
|
|
Object.keys(item.subCategory ?? {}).forEach((subCategory) => { |
|
|
|
if (item.name === UNKNOWN_KEY) { |
|
|
|
// @ts-ignore
|
|
|
|
backgroundColorSubCategory.push(item.color); |
|
|
|
} else { |
|
|
|
backgroundColorSubCategory.push( |
|
|
|
Color(item.color).lighten(lightnessRatio).hex() |
|
|
|
); |
|
|
|
} |
|
|
|
// @ts-ignore
|
|
|
|
dataSubCategory.push(item.subCategory[subCategory].value.toNumber()); |
|
|
|
labelSubCategory.push(subCategory); |
|
|
|
|
|
|
|
|
|
|
|
@ -132,7 +132,7 @@ export class AdminService { |
|
|
|
public fetchJobs({ status }: { status?: JobStatus[] }) { |
|
|
|
let params = new HttpParams(); |
|
|
|
|
|
|
|
if (status?.length > 0) { |
|
|
|
if (status && status.length > 0) { |
|
|
|
params = params.append('status', status.join(',')); |
|
|
|
} |
|
|
|
|
|
|
|
@ -158,8 +158,8 @@ export class AdminService { |
|
|
|
}) { |
|
|
|
let params = new HttpParams(); |
|
|
|
|
|
|
|
params = params.append('skip', skip); |
|
|
|
params = params.append('take', take); |
|
|
|
if (skip) params = params.append('skip', skip); |
|
|
|
if (take) params = params.append('take', take); |
|
|
|
|
|
|
|
return this.http.get<AdminUsersResponse>('/api/v1/admin/user', { params }); |
|
|
|
} |
|
|
|
|
|
|
|
@ -89,7 +89,7 @@ export class DataService { |
|
|
|
public buildFiltersAsQueryParams({ filters }: { filters?: Filter[] }) { |
|
|
|
let params = new HttpParams(); |
|
|
|
|
|
|
|
if (filters?.length > 0) { |
|
|
|
if (filters && filters.length > 0) { |
|
|
|
const { |
|
|
|
ACCOUNT: filtersByAccount, |
|
|
|
ASSET_CLASS: filtersByAssetClass, |
|
|
|
|
|
|
|
@ -137,7 +137,7 @@ export abstract class AbstractMatFormField<T> |
|
|
|
|
|
|
|
public ngDoCheck() { |
|
|
|
if (this.ngControl) { |
|
|
|
this.errorState = this.ngControl.invalid && this.ngControl.touched; |
|
|
|
this.errorState = !!(this.ngControl.invalid && this.ngControl.touched); |
|
|
|
this.stateChanges.next(); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
@ -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 }); |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
@ -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) { |
|
|
|
|
|
|
|
@ -26,13 +26,15 @@ export class GfToggleComponent implements OnChanges { |
|
|
|
|
|
|
|
@Output() valueChange = new EventEmitter<Pick<ToggleOption, 'value'>>(); |
|
|
|
|
|
|
|
public optionFormControl = new FormControl<string>(undefined); |
|
|
|
public optionFormControl = new FormControl<string | null>(null); |
|
|
|
|
|
|
|
public ngOnChanges() { |
|
|
|
this.optionFormControl.setValue(this.defaultValue); |
|
|
|
} |
|
|
|
|
|
|
|
public onValueChange() { |
|
|
|
this.valueChange.emit({ value: this.optionFormControl.value }); |
|
|
|
if (this.optionFormControl.value !== null) { |
|
|
|
this.valueChange.emit({ value: this.optionFormControl.value }); |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
@ -19,6 +19,7 @@ |
|
|
|
"target": "es2020", |
|
|
|
// TODO: Remove once solved in tsconfig.base.json |
|
|
|
"strict": false, |
|
|
|
"strictNullChecks": true, |
|
|
|
"noImplicitReturns": true, |
|
|
|
"noFallthroughCasesInSwitch": true |
|
|
|
}, |
|
|
|
|