diff --git a/apps/client/src/app/components/header/header.component.html b/apps/client/src/app/components/header/header.component.html index dc9a3af0f..778d0529d 100644 --- a/apps/client/src/app/components/header/header.component.html +++ b/apps/client/src/app/components/header/header.component.html @@ -153,6 +153,7 @@ " [hasPermissionToChangeDateRange]="hasPermissionToChangeDateRange" [hasPermissionToChangeFilters]="hasPermissionToChangeFilters" + [info]="info" [user]="user" (closed)="closeAssistant()" (dateRangeChanged)="onDateRangeChange($event)" diff --git a/apps/client/src/app/components/header/header.component.ts b/apps/client/src/app/components/header/header.component.ts index f1a6a22b6..a3261e053 100644 --- a/apps/client/src/app/components/header/header.component.ts +++ b/apps/client/src/app/components/header/header.component.ts @@ -208,6 +208,8 @@ export class HeaderComponent implements OnChanges { userSetting['filters.accounts'] = filter.id ? [filter.id] : null; } else if (filter.type === 'ASSET_CLASS') { userSetting['filters.assetClasses'] = filter.id ? [filter.id] : null; + } else if (filter.type === 'BASE_CURRENCY') { + userSetting['baseCurrency'] = filter.id ? filter.id : null; } else if (filter.type === 'DATA_SOURCE') { userSetting['filters.dataSource'] = filter.id ? filter.id : null; } else if (filter.type === 'SYMBOL') { diff --git a/client.log b/client.log new file mode 100644 index 000000000..d34f848c3 --- /dev/null +++ b/client.log @@ -0,0 +1,14 @@ + +> ghostfolio@2.190.0 start:client +> nx run client:copy-assets && nx run client:serve --configuration=development-en --hmr -o + + +> nx run client:copy-assets + +> shx rm -rf dist/apps/client + +> shx mkdir -p dist/apps/client/.well-known + +> shx mkdir -p dist/apps/client/assets + +> shx cp -r apps/client/src/assets/* dist/apps/client/assets diff --git a/libs/ui/src/lib/assistant/assistant.component.ts b/libs/ui/src/lib/assistant/assistant.component.ts index 032b3222d..28d0e8b79 100644 --- a/libs/ui/src/lib/assistant/assistant.component.ts +++ b/libs/ui/src/lib/assistant/assistant.component.ts @@ -2,7 +2,12 @@ import { GfSymbolModule } from '@ghostfolio/client/pipes/symbol/symbol.module'; import { AdminService } from '@ghostfolio/client/services/admin.service'; import { DataService } from '@ghostfolio/client/services/data.service'; import { getAssetProfileIdentifier } from '@ghostfolio/common/helper'; -import { Filter, PortfolioPosition, User } from '@ghostfolio/common/interfaces'; +import { + Filter, + InfoItem, + PortfolioPosition, + User +} from '@ghostfolio/common/interfaces'; import { InternalRoute } from '@ghostfolio/common/routes/interfaces/internal-route.interface'; import { internalRoutes } from '@ghostfolio/common/routes/routes'; import { DateRange } from '@ghostfolio/common/types'; @@ -127,6 +132,7 @@ export class GfAssistantComponent implements OnChanges, OnDestroy, OnInit { @Input() hasPermissionToAccessAdminControl: boolean; @Input() hasPermissionToChangeDateRange: boolean; @Input() hasPermissionToChangeFilters: boolean; + @Input() info: InfoItem; @Input() user: User; @Output() closed = new EventEmitter(); @@ -143,11 +149,13 @@ export class GfAssistantComponent implements OnChanges, OnDestroy, OnInit { public accounts: Account[] = []; public assetClasses: Filter[] = []; + public currencies: Filter[] = []; public dateRangeFormControl = new FormControl(undefined); public dateRangeOptions: IDateRangeOption[] = []; public filterForm = this.formBuilder.group({ account: new FormControl(undefined), assetClass: new FormControl(undefined), + baseCurrency: new FormControl(undefined), holding: new FormControl(undefined), tag: new FormControl(undefined) }); @@ -170,6 +178,7 @@ export class GfAssistantComponent implements OnChanges, OnDestroy, OnInit { private filterTypes: Filter['type'][] = [ 'ACCOUNT', 'ASSET_CLASS', + 'BASE_CURRENCY', 'DATA_SOURCE', 'SYMBOL', 'TAG' @@ -343,6 +352,14 @@ export class GfAssistantComponent implements OnChanges, OnDestroy, OnInit { public ngOnChanges() { this.accounts = this.user?.accounts ?? []; + this.currencies = this.info.currencies.map((currency) => { + return { + id: currency.id, + label: currency.id, + type: 'BASE_CURRENCY' + }; + }); + this.dateRangeOptions = [ { label: $localize`Today`, @@ -509,6 +526,10 @@ export class GfAssistantComponent implements OnChanges, OnDestroy, OnInit { id: this.filterForm.get('assetClass').value, type: 'ASSET_CLASS' }, + { + id: this.filterForm.get('baseCurrency').value, + type: 'BASE_CURRENCY' + }, { id: this.filterForm.get('holding').value?.dataSource, type: 'DATA_SOURCE' @@ -682,6 +703,7 @@ export class GfAssistantComponent implements OnChanges, OnDestroy, OnInit { { account: this.user?.settings?.['filters.accounts']?.[0] ?? null, assetClass: this.user?.settings?.['filters.assetClasses']?.[0] ?? null, + baseCurrency: this.user?.settings?.baseCurrency ?? null, holding: selectedHolding ?? null, tag: this.user?.settings?.['filters.tags']?.[0] ?? null }, diff --git a/libs/ui/src/lib/assistant/assistant.html b/libs/ui/src/lib/assistant/assistant.html index f957d9dcc..a68a4f611 100644 --- a/libs/ui/src/lib/assistant/assistant.html +++ b/libs/ui/src/lib/assistant/assistant.html @@ -226,6 +226,19 @@ +
+ + Base Currency + + + @for (currency of currencies; track currency.id) { + {{ + currency.label + }} + } + + +