|
|
@ -22,7 +22,7 @@ import { DataService } from '@ghostfolio/client/services/data.service'; |
|
|
|
import { Filter, User } from '@ghostfolio/common/interfaces'; |
|
|
|
import { DateRange } from '@ghostfolio/common/types'; |
|
|
|
import { translate } from '@ghostfolio/ui/i18n'; |
|
|
|
import { Account, AssetClass, Tag } from '@prisma/client'; |
|
|
|
import { Account, AssetClass } from '@prisma/client'; |
|
|
|
import { EMPTY, Observable, Subject, lastValueFrom } from 'rxjs'; |
|
|
|
import { |
|
|
|
catchError, |
|
|
@ -158,25 +158,6 @@ export class AssistantComponent implements OnChanges, OnDestroy, OnInit { |
|
|
|
}; |
|
|
|
}); |
|
|
|
|
|
|
|
this.filterForm.valueChanges |
|
|
|
.pipe(takeUntil(this.unsubscribeSubject)) |
|
|
|
.subscribe(({ account, assetClass, tag }) => { |
|
|
|
this.filtersChanged.emit([ |
|
|
|
{ |
|
|
|
id: account, |
|
|
|
type: 'ACCOUNT' |
|
|
|
}, |
|
|
|
{ |
|
|
|
id: assetClass, |
|
|
|
type: 'ASSET_CLASS' |
|
|
|
}, |
|
|
|
{ |
|
|
|
id: tag, |
|
|
|
type: 'TAG' |
|
|
|
} |
|
|
|
]); |
|
|
|
}); |
|
|
|
|
|
|
|
this.searchFormControl.valueChanges |
|
|
|
.pipe( |
|
|
|
map((searchTerm) => { |
|
|
@ -260,6 +241,25 @@ export class AssistantComponent implements OnChanges, OnDestroy, OnInit { |
|
|
|
this.changeDetectorRef.markForCheck(); |
|
|
|
} |
|
|
|
|
|
|
|
public onApplyFilters() { |
|
|
|
this.filtersChanged.emit([ |
|
|
|
{ |
|
|
|
id: this.filterForm.get('account').value, |
|
|
|
type: 'ACCOUNT' |
|
|
|
}, |
|
|
|
{ |
|
|
|
id: this.filterForm.get('assetClass').value, |
|
|
|
type: 'ASSET_CLASS' |
|
|
|
}, |
|
|
|
{ |
|
|
|
id: this.filterForm.get('tag').value, |
|
|
|
type: 'TAG' |
|
|
|
} |
|
|
|
]); |
|
|
|
|
|
|
|
this.onCloseAssistant(); |
|
|
|
} |
|
|
|
|
|
|
|
public onChangeDateRange(dateRangeString: string) { |
|
|
|
this.dateRangeChanged.emit(dateRangeString as DateRange); |
|
|
|
} |
|
|
|