Skip to content

Open Source Wealth Management Software. Angular + NestJS + Prisma + Nx + TypeScript 🤍

Feature/add platform logo to account selector in create or update activity dialog (#7524)

Thomas Kaul5bbdf52e191d
diff --git a/CHANGELOG.md b/CHANGELOG.md
index 0b5d734951..fb6b3ef374 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -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
diff --git a/apps/api/src/app/user/user.service.ts b/apps/api/src/app/user/user.service.ts
index 10e9c5240e..8fb11ad345 100644
--- a/apps/api/src/app/user/user.service.ts
+++ b/apps/api/src/app/user/user.service.ts
@@ -136,6 +136,7 @@ export class UserService {
where: { granteeUserId: id }
}),
this.prismaService.account.findMany({
+ include: { platform: true },
orderBy: {
name: 'asc'
},
diff --git a/apps/client/src/app/pages/portfolio/activities/create-or-update-activity-dialog/create-or-update-activity-dialog.component.ts b/apps/client/src/app/pages/portfolio/activities/create-or-update-activity-dialog/create-or-update-activity-dialog.component.ts
index 3b80d28251..07f596711b 100644
--- a/apps/client/src/app/pages/portfolio/activities/create-or-update-activity-dialog/create-or-update-activity-dialog.component.ts
+++ b/apps/client/src/app/pages/portfolio/activities/create-or-update-activity-dialog/create-or-update-activity-dialog.component.ts
@@ -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(
diff --git a/apps/client/src/app/pages/portfolio/activities/create-or-update-activity-dialog/create-or-update-activity-dialog.html b/apps/client/src/app/pages/portfolio/activities/create-or-update-activity-dialog/create-or-update-activity-dialog.html
index b5dbf46693..b3c7081675 100644
--- a/apps/client/src/app/pages/portfolio/activities/create-or-update-activity-dialog/create-or-update-activity-dialog.html
+++ b/apps/client/src/app/pages/portfolio/activities/create-or-update-activity-dialog/create-or-update-activity-dialog.html
@@ -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) {
diff --git a/apps/client/src/app/pages/portfolio/activities/create-or-update-activity-dialog/interfaces/interfaces.ts b/apps/client/src/app/pages/portfolio/activities/create-or-update-activity-dialog/interfaces/interfaces.ts
index a3d58f8eb0..7faed5312f 100644
--- a/apps/client/src/app/pages/portfolio/activities/create-or-update-activity-dialog/interfaces/interfaces.ts
+++ b/apps/client/src/app/pages/portfolio/activities/create-or-update-activity-dialog/interfaces/interfaces.ts
@@ -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;