|
|
@ -167,8 +167,6 @@ export class GfAssistantComponent implements OnChanges, OnDestroy, OnInit {
|
|
|
|
) {}
|
|
|
|
) {}
|
|
|
|
|
|
|
|
|
|
|
|
public ngOnInit() {
|
|
|
|
public ngOnInit() {
|
|
|
|
this.initializeFilterForm();
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
this.assetClasses = Object.keys(AssetClass).map((assetClass) => {
|
|
|
|
this.assetClasses = Object.keys(AssetClass).map((assetClass) => {
|
|
|
|
return {
|
|
|
|
return {
|
|
|
|
id: assetClass,
|
|
|
|
id: assetClass,
|
|
|
@ -272,12 +270,6 @@ export class GfAssistantComponent implements OnChanges, OnDestroy, OnInit {
|
|
|
|
|
|
|
|
|
|
|
|
this.filterForm.disable({ emitEvent: false });
|
|
|
|
this.filterForm.disable({ emitEvent: false });
|
|
|
|
|
|
|
|
|
|
|
|
if (this.hasPermissionToChangeFilters) {
|
|
|
|
|
|
|
|
this.filterForm.enable({ emitEvent: false });
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
this.initializeFilterForm();
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
this.tags =
|
|
|
|
this.tags =
|
|
|
|
this.user?.tags
|
|
|
|
this.user?.tags
|
|
|
|
?.filter(({ isUsed }) => {
|
|
|
|
?.filter(({ isUsed }) => {
|
|
|
@ -315,7 +307,7 @@ export class GfAssistantComponent implements OnChanges, OnDestroy, OnInit {
|
|
|
|
);
|
|
|
|
);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
public async initialize() {
|
|
|
|
public initialize() {
|
|
|
|
this.isLoading = true;
|
|
|
|
this.isLoading = true;
|
|
|
|
this.keyManager = new FocusKeyManager(this.assistantListItems).withWrap();
|
|
|
|
this.keyManager = new FocusKeyManager(this.assistantListItems).withWrap();
|
|
|
|
this.searchResults = {
|
|
|
|
this.searchResults = {
|
|
|
@ -335,7 +327,25 @@ export class GfAssistantComponent implements OnChanges, OnDestroy, OnInit {
|
|
|
|
this.isLoading = false;
|
|
|
|
this.isLoading = false;
|
|
|
|
this.setIsOpen(true);
|
|
|
|
this.setIsOpen(true);
|
|
|
|
|
|
|
|
|
|
|
|
this.changeDetectorRef.markForCheck();
|
|
|
|
this.dataService
|
|
|
|
|
|
|
|
.fetchPortfolioHoldings()
|
|
|
|
|
|
|
|
.pipe(takeUntil(this.unsubscribeSubject))
|
|
|
|
|
|
|
|
.subscribe(({ holdings }) => {
|
|
|
|
|
|
|
|
this.holdings = holdings
|
|
|
|
|
|
|
|
.filter(({ assetSubClass }) => {
|
|
|
|
|
|
|
|
return !['CASH'].includes(assetSubClass);
|
|
|
|
|
|
|
|
})
|
|
|
|
|
|
|
|
.sort((a, b) => {
|
|
|
|
|
|
|
|
return a.name?.localeCompare(b.name);
|
|
|
|
|
|
|
|
});
|
|
|
|
|
|
|
|
this.setFilterFormValues();
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (this.hasPermissionToChangeFilters) {
|
|
|
|
|
|
|
|
this.filterForm.enable({ emitEvent: false });
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
this.changeDetectorRef.markForCheck();
|
|
|
|
|
|
|
|
});
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
public onApplyFilters() {
|
|
|
|
public onApplyFilters() {
|
|
|
@ -499,22 +509,6 @@ export class GfAssistantComponent implements OnChanges, OnDestroy, OnInit {
|
|
|
|
);
|
|
|
|
);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
private initializeFilterForm() {
|
|
|
|
|
|
|
|
this.dataService
|
|
|
|
|
|
|
|
.fetchPortfolioHoldings()
|
|
|
|
|
|
|
|
.pipe(takeUntil(this.unsubscribeSubject))
|
|
|
|
|
|
|
|
.subscribe(({ holdings }) => {
|
|
|
|
|
|
|
|
this.holdings = holdings
|
|
|
|
|
|
|
|
.filter(({ assetSubClass }) => {
|
|
|
|
|
|
|
|
return !['CASH'].includes(assetSubClass);
|
|
|
|
|
|
|
|
})
|
|
|
|
|
|
|
|
.sort((a, b) => {
|
|
|
|
|
|
|
|
return a.name?.localeCompare(b.name);
|
|
|
|
|
|
|
|
});
|
|
|
|
|
|
|
|
this.setFilterFormValues();
|
|
|
|
|
|
|
|
});
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
private setFilterFormValues() {
|
|
|
|
private setFilterFormValues() {
|
|
|
|
const dataSource = this.user?.settings?.[
|
|
|
|
const dataSource = this.user?.settings?.[
|
|
|
|
'filters.dataSource'
|
|
|
|
'filters.dataSource'
|
|
|
|