Browse Source
Feature/add platform logo to account selector in create or update activity dialog (#7524)
* Add platform logo to account selector
* Update changelog
pull/7528/head^2
Thomas Kaul
4 days ago
committed by
GitHub
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
5 changed files with
28 additions and
3 deletions
-
CHANGELOG.md
-
apps/api/src/app/user/user.service.ts
-
apps/client/src/app/pages/portfolio/activities/create-or-update-activity-dialog/create-or-update-activity-dialog.component.ts
-
apps/client/src/app/pages/portfolio/activities/create-or-update-activity-dialog/create-or-update-activity-dialog.html
-
apps/client/src/app/pages/portfolio/activities/create-or-update-activity-dialog/interfaces/interfaces.ts
|
|
|
@ -5,6 +5,12 @@ All notable changes to this project will be documented in this file. |
|
|
|
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), |
|
|
|
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). |
|
|
|
|
|
|
|
## Unreleased |
|
|
|
|
|
|
|
### Added |
|
|
|
|
|
|
|
- Added the platform logo to the account selector in the create or update activity dialog |
|
|
|
|
|
|
|
## 3.42.0 - 2026-08-04 |
|
|
|
|
|
|
|
### Changed |
|
|
|
|
|
|
|
@ -136,6 +136,7 @@ export class UserService { |
|
|
|
where: { granteeUserId: id } |
|
|
|
}), |
|
|
|
this.prismaService.account.findMany({ |
|
|
|
include: { platform: true }, |
|
|
|
orderBy: { |
|
|
|
name: 'asc' |
|
|
|
}, |
|
|
|
|
|
|
|
@ -121,6 +121,12 @@ export class GfCreateOrUpdateActivityDialogComponent { |
|
|
|
addIcons({ calendarClearOutline, refreshOutline }); |
|
|
|
} |
|
|
|
|
|
|
|
protected get selectedAccount() { |
|
|
|
return this.data.accounts.find(({ id }) => { |
|
|
|
return id === this.activityForm.get('accountId')?.value; |
|
|
|
}); |
|
|
|
} |
|
|
|
|
|
|
|
public ngOnInit() { |
|
|
|
this.currencyOfAssetProfile = this.data.activity?.assetProfile?.currency; |
|
|
|
this.hasPermissionToCreateOwnTag = hasPermission( |
|
|
|
|
|
|
|
@ -85,6 +85,19 @@ |
|
|
|
> |
|
|
|
<mat-label i18n>Account</mat-label> |
|
|
|
<mat-select formControlName="accountId"> |
|
|
|
<mat-select-trigger> |
|
|
|
<div class="d-flex"> |
|
|
|
@if (selectedAccount?.platform?.url) { |
|
|
|
<gf-entity-logo |
|
|
|
class="mr-1" |
|
|
|
[tooltip]="selectedAccount?.platform?.name" |
|
|
|
[url]="selectedAccount?.platform?.url" |
|
|
|
/> |
|
|
|
} |
|
|
|
<span>{{ selectedAccount?.name }}</span> |
|
|
|
</div> |
|
|
|
</mat-select-trigger> |
|
|
|
|
|
|
|
<mat-option [value]="null" /> |
|
|
|
|
|
|
|
@for (account of data.accounts; track account) { |
|
|
|
|
|
|
|
@ -1,9 +1,8 @@ |
|
|
|
import { Activity, User } from '@ghostfolio/common/interfaces'; |
|
|
|
|
|
|
|
import { Account } from '@prisma/client'; |
|
|
|
import { AccountWithPlatform } from '@ghostfolio/common/types'; |
|
|
|
|
|
|
|
export interface CreateOrUpdateActivityDialogParams { |
|
|
|
accounts: Account[]; |
|
|
|
accounts: AccountWithPlatform[]; |
|
|
|
activity: Partial<Omit<Activity, 'assetProfile' | 'id' | 'unitPrice'>> & { |
|
|
|
assetProfile: Activity['assetProfile'] | null; |
|
|
|
id: string | null; |
|
|
|
|